/* age.c: Comments on your age */
#include <stdio.h>
int main() {
int age;
char chr='y';
while(1)
{
printf("Enter your age:");
scanf("%d", &age);
if (age < 20)
printf("youth");
else if (age < 40)
printf("prime");
else if (age < 60)
printf("aches and pains");
else if (age < 80)
printf("golden");
else {
char really;
printf("Are you really %d?\n", age);
scanf(" %c", &really);
if (really == 'Y' || really == 'y')
printf("Congratulations!");
else
printf("I didn't think so!");
}
printf("want to quit?\n");
scanf("%c",&chr);
if(chr=='y')
break;
}
printf("nice!!") ;
getch();
return 0;
}提问啦"为什么在 printf("want to quit?\n");之后程序就直接提示 printf("Enter your age:");了啊?
我还没有确定 printf("want to quit?\n"); 的呀?