#include #include #include #include #include int main() { printf(" ******************1-2年级小学生数学测验******************\n"); printf("开始答题:\n"); int num=0,grade=0; int score[3]={10,7,5}; char str[100],str1[10][100]; while(1) { int a=0,b=0,d,c,k=0,i,j=-1,result; char op[2]={'+','-'}; //系统出题 while(1) { a=rand()%51; srand((unsigned)time(NULL)); b=rand()%51; srand((unsigned)time(NULL)); d=rand()%2; if(d==0){ c=a+b;} else{ c=a-b;} // 判断题目 if(c>=0 && c<=50){ sprintf(str,"%d%c%d = \n",a,op[d],b); strcpy(str1[num],str); if(num==0) break;sprintf j=-1; for(i=0; i=90)printf("%d ******************SMART******************",grade); else if(grade>=80)printf("%d ******************GOOD******************",grade); else if(grade>=70)printf("%d ******************OK******************",grade); else if(grade>=60)printf("%d ******************PASS******************",grade); else printf("%d ******************TRY AGAIN****************** ",grade); getch(); }