“按下CTRL+Z终止程序”但没有终止
#include<stdio.h>
int main()
{
char x;
while (scanf_s("%c",&x,1) != EOF)
{
if(x=='r')
{
printf("stop\n");
getchar();
continue;
}
if (x == 'g')
{
printf("go go go \n");
getchar();
continue;
}
if (x == 'y')
{
printf("wait a minute\n");
getchar();
continue;
}
else
{
printf("something must be wrong ...\n");
getchar();
continue;
}
}
}