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;
}