猜数字游戏

猜数字游戏

/problem-sets/1325975206586703872/problems/1325977648841842689

#include<stdio.h>
int main(void)
{
	int key,i,num,N;//int T_F=0;
	scanf("%d%d",&key,&N);
	for(i=1;i<=N;i++)
	{
		scanf("%d",&num);
		if(num<0)break;
		if(num==key)
		{
			switch(i)
			{
				case 1:printf("Bingo!\n");goto end;
				case 2:printf("Lucky You!\n");goto end;
				case 3:printf("Lucky You!\n");goto end;
				default:printf("Good Guess!\n");goto end;
			}
		}
		else
		{
			if(num<key)printf("Too small\n");
			else printf("Too big\n");
		}
	}printf("Game Over\n");
	end:
	return 0;
} 
posted @ 2020-11-10 19:06  summeriver13  阅读(22)  评论(0)    收藏  举报