Dopo ogni scanf inserisci una linea

while(getchar()!='\n');

per svuotare il buffer