4-4. 猜数字游戏(15)

来源:互联网 发布:python socket arp 编辑:程序博客网 时间:2024/06/06 07:31
#include <stdio.h>int main() {int number, n;int count = 0;int value;scanf("%d%d", &number, &n);while(count <= n) {scanf("%d", &value);if(value < 0) {printf("Game Over\n");break;}++count;if(value > number)printf("Too big\n");else if(value < number)printf("Too small\n");else {if(count == 1)printf("Bingo!\n");else if(count <= 3)printf("Lucky You!\n");else if(count <= n)printf("Good Guess!\n");break;}}if(count > n)printf("Game Over\n");return 0;}

0 0
原创粉丝点击