永发信息网

C程序结果问题

答案:2  悬赏:40  手机版
解决时间 2021-05-06 01:35
  • 提问者网友:不爱我么
  • 2021-05-05 05:25
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
main()
{
int magic;
int guess;
char vae;
srand(time(NULL));


do{
magic=rand()%100;
printf("please guess a magic number:");
scanf("%d",&guess);
if(guess>magic){
printf("wrong!too high!\n");
}
else if(guess<magic){printf("wrong!too low!\n");}
else {printf("congrandunations!\n");
printf("are you continue!y|n\n");
scanf(" %c",&vae);
}
}while(1);
}
结果出问题,帮帮忙。
最佳答案
  • 五星知识达人网友:舊物识亽
  • 2021-05-05 05:38

#include<stdio.h>
#include<time.h>
#include<stdlib.h>
main()
{
int magic;
int guess;
char vae;
srand(time(NULL));


do{
magic=rand()%100;
printf("please guess a magic number:");
scanf("%d",&guess);
if(guess>magic){
printf("wrong!too high!\n");
}
else if(guess<magic){printf("wrong!too low!\n");}
else {printf("congrandunations!\n");
printf("are you continue!y|n\n");
scanf(" %c",&vae);


if(!(vae=='y' || vae =='Y'))


break;
}
}while(1);
}

全部回答
  • 1楼网友:不甚了了
  • 2021-05-05 06:32
出了什么问题呢??
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯