You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

6 years ago
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int sjfu()
{ srand( (unsigned)time( NULL ));
return rand()%2;
}
int main()
{
char a[]={'+','-'};
6 years ago
int b,c,d,t,i,j,f,su=0;
6 years ago
int daan,fenshu=0;
6 years ago
printf("--------------------------------------------------------------\n");
printf("\n\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>10<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>\n\t<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ż<EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD><EFBFBD>\n\n");
printf("--------------------------------------------------------------\n\n");
6 years ago
for(i=0;i<10;i++)
{
srand( (unsigned)time( NULL ));
6 years ago
b=rand()%51;
c=rand()%51;
6 years ago
d=sjfu();
if(b<c)
{ t=b;b=c;c=t;}
switch(a[d])
{
case '+':{daan=b+c;break;}
case '-':{daan=b-c;break;}
} //<2F>ó<EFBFBD><C3B3><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>
if(daan>50)
{ i-=1;continue;} //<2F>ж<EFBFBD><D0B6><EFBFBD>ʽ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>
6 years ago
su=i;
printf("<EFBFBD><EFBFBD>%d<><64>\n",su+1);
printf("\t%d%c%d=?\n\n",b,a[d],c); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>
6 years ago
for(j=0;j<3;j++)
{
scanf("%d",&f);
if(f==daan)
break;
else
6 years ago
printf("<EFBFBD>𰸲<EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
} //<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𰸣<EFBFBD><F0B0B8A3><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
6 years ago
switch(j)
{
case 0:{fenshu+=10;break;}
case 1:{fenshu+=7;break;}
case 2:{fenshu+=5;break;}
6 years ago
case 3:{fenshu+=0;printf("\n\t<EFBFBD>ܿ<EFBFBD>ϧ\n\t<EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d\n",daan);break;}
} //<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD>𰸣<EFBFBD><F0B0B8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD>
printf("\n--------------------------------------------------------------\n\n");
6 years ago
}
if(fenshu>=90)
printf("SMART\n");
else if(fenshu<90&&fenshu>=80)
printf("GOOD\n");
else if(fenshu<80&&fenshu>=70)
printf("OK\n");
else if(fenshu<70&&fenshu>=60)
printf("PASS\n");
else
6 years ago
printf("TRY AGAIN\n"); //<2F>жϵȼ<CFB5>
6 years ago
return 0;
}