#include <stdio.h>
void mian()
{
int num=18;
int ans;
int c=0;
printf("请猜一猜我的年龄是多少?\n");
do
{
scanf("%d",&ans);
if(num>ans)
printf("讨厌!人家有这么小吗?\n");
else if(num<ans)
printf("去死!把人家说得这么老!\n");
else
printf("你真厉害!难道你就是命中注定的另一半?!\n");
}
while(num!=ans);
if(c==1)
printf("s\n");
if(c>1 && c<3)
printf("A\n");
if(c>3 && c<6)
printf("B\n");
if(c>6)
printf("foolish!\n");
}
修改完整如下 :
#include <stdio.h>