#include<stdio.h>
#include<stdlib.h>
#include<time.h>
void main()
{
int ret = 0;
int i = 0;
int rnd = 0;
int level = 10;
srand((unsigned int)time(NULL));
ret = rand()%90;
printf("Ganestart!\n");
while(1)
{
printf("请输入一个数:");
scanf("%d",&rnd);
if(rnd>ret){
printf("Too big! \n");
}else if(rnd<ret){
printf("Too small! \n");
}else{
break;
}
level--;
if(level<=0){
printf("You Failed! The aumber is r");
exit(0);
}
}
switch(level){
case 10:
printf("Congratulation! Your gessind Lerel is S");
break;
case 9:
printf("Congratulation! Your gessind Lerel is A");
break;
case 8:
printf("Congratulation! Your gessind Lerel is B");
break;
case 7:
printf("Congratulation! Your gessind Lerel is C");
break;
case 6:
printf("Congratulation! Your gessind Lerel is D");
break;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:
printf("Congratulation! Your gessind Lerel is E");
break;
}
return 0;
}