#include"stdio.h"

main()

{ int m,n,i,score,j0,j1;

n=1;m=87; /*m为所猜的数*/

j1=400;j0=0; /*j1为最大限度，j0为最小限度*/

clrscr();

score=100;

while(n<=20)

{{printf("input the guess number:\n");

scanf("%d",&i);

if(i==m)

{ printf("you are right at %d times!\n",n);

printf("your score is %d\n",score);

getchar();

getchar();

break;}

else if(i<0||i>j1)

printf("erorr! 0---%d\n",j1);

else if(i<m)

{printf("erorr! %d---%d\n",i,j1);

j0=i;}

else

{printf("erorr! %d---%d\n",j0,i);

j1=i;}

n=n+1;

if(n==21)

{printf("sorry! you are fall.\n");

printf("your score is 0\n");

getchar();

getchar();}}

if(n<=3) score=90;

else if(n<=10) score=80;

else if(n<=15) score=70;

else score=60;}

}

