为什么scanf卡在do中而卡住了?当我运行程序时,它总是卡在那儿,我不知道为什么
#include <stdlib.h>
#include <stdio.h>
int main()
{
int c;
char i[20];
char a [50] = {"abcdefghilmnopqrstuvzabcdefghilmnopqrstuvz"};
printf("inserisci la frase \n");
scanf("%c", &i);
do{
printf("la Chiave e' (max 21) \n");
scanf("%d",&c);
}while(c<0 || c>21);
printf("avviarsi della codifica...");
}