程序:
#include <stdio.h>
int main()
{
int num, times;
scanf("%d %d", &num,×); int i = , guess;
while(i< times){
scanf("%d", &guess);
if(guess < ){
printf("Game Over\n");
break;
}
if(guess > num){
printf("Too big\n");
}
if(guess < num){
printf("Too small\n");
}
if(guess ==num){
if(i == ){
printf("Bingo!\n");
}else if(i < ){
printf("Lucky You!\n");
}
else{
printf("Good Guess!\n");
}
break;
}
i++;
}
if(i>= times){
printf("Game Over\n");
}
}
主要考察循环和判断