int main()
{
int rat = 0;
char password[20] = { 0 };
printf("输入密码:");
scanf("%s", password);
while ((rat = getchar()) != '\n')
{
;
}
printf("请确认输入(y/n):");
rat = getchar();
if (rat == 'y')
{
printf("correct\n");
}
else
{
printf("error\n");
}
return 0;
}
清理缓存区
最新推荐文章于 2024-07-18 20:52:11 发布