#include<stdio.h>
int main ()
{
int num, n; //游戏机产生的随机数、以及猜测的最大次数n
scanf("%d %d", &num, &n);
int pn, count = 0;
for(int i=1; i <= n; i++){
scanf("%d", &pn);
count++;
if(count == 1 && pn == num){
printf("Bingo!");
break;
}
else if(count <= 3 && count > 1 && pn == num ){
printf("Lucky You!");
break;
}
else{
if(pn < 0){
printf("Game Over");
break;
}
if(pn > num){
printf("Too big\n");
}
if(pn < num){
printf("Too small\n");
}
if(pn == num){
printf("Good Guess!");
}
}
}
if(pn != num && count == n){
printf("Game Over");
}
return 0;
}
猜数字游戏 (15分)
最新推荐文章于 2022-06-02 16:45:00 发布