分类：电脑/网络-互联网
问题：小学生数学辅助学习系统 
回答：程序中没有加入扩充功能，和图形 没有加入混合运算的代码，己留空间。case 5. 因那样完全做好的话分应不够的了。 其它都符合要求。结果图形见我的空间.   看了图片觉得可以把代码给你啊。 我用的是TC 编译，在练习或测试中按ESC返回上级选单，当前题不计分。 #include <stdio.h>#include <math.h>#include <time.h>#include <stdlib.h>#define MAX 100#define N 10struct math {int a;char o;int b;int mr;int rr;};typedef struct math  MATH;int menu1(){char c;printf("\n\n               1.Practice\n");printf("\n               2.Test\n");printf("\n               ESC exit\n");printf("\nEnter choice: "); c=getch(); if(c!=27) printf("%c",c); else  printf("ESC");printf("\n\n");return c;}int menu2(){ char c;printf("\n\n               1.A+B\n");printf("\n               2.A-B\n");printf("\n               3.A*B\n");printf("\n               4.A/B\n");printf("\n               5.A*B+C-D/E\n");printf("\n               ESC return\n");printf("\nEnter choice: "); c=getch(); if(c!=27) printf("%c",c);  else  printf("ESC");printf("\n\n");return c;}void get_ti(MATH *ti,int flag){int tem;  switch(flag){       case '1':        ti->o='+';       while(1){       ti->a=rand()%51;       ti->b=rand()%51;       if(ti->a!=ti->b)       break;       }       break;       case '2':       ti->o='-';       while(1){       ti->a=rand()%101;       ti->b=rand()%101;        if(ti->a!=ti->b)       break;       }       if(ti->a<ti->b){        tem=ti->a;        ti->a=ti->b;        ti->b=tem;        }        break;       case '3':       ti->o='*';         ti->a=rand()%51+1;         if(ti->a==51)           ti->a=100;          ti->b=100/(ti->a);          break;       case '4':       ti->o='/';       while(1){          ti->a=rand()%100+1;       ti->b=rand()%100+1;         if(ti->a!=ti->b){            if(ti->a<ti->b){        tem=ti->a;        ti->a=ti->b;        ti->b=tem;        }           if(ti->a%ti->b==0)       break;       }       }       break;  }}int  getans(char *ans){int i=0;char c; while(1){ c=getch(); if(c>=48&&c<=57){    ans[i]=c; printf("%c",ans[i]);   i++;   continue;   } if(c==27) return 1; if(c=='\b'){ if(i>0) printf("%c%c%c",'\b',' ','\b');  i--;  } if(c=='\r') break; } ans[i]='\0'; return 0; }main(){int m1,m2,r,mr,i,j,k,rnum,wnum,tinum,flag,flag1;MATH ti,test_ti[N];float rate;char ans[5]; randomize();while(1){   /*1*/m1=menu1();switch (m1){ /*1*//*****************************/ case '1': tinum=0; rnum=0; wnum=0;  flag=0;/*-------------------------*/ while(1){    flag1=0; m2=menu2();    /*aaaaaaaaaaaaaaaaaaaaaaaaaaaa*/     switch (m2){       case '1':        for(j=0;j<5;j++){       get_ti(&ti,'1');       tinum++;       r=ti.a+ti.b;       for(i=1;i<4;i++){       if(i==1)       printf("\n(%d)%d. %2d%c%2d=",j+1,i,ti.a,'+',ti.b);       else         printf("\n%4d. %2d%c%2d=",i,ti.a,'+',ti.b);         if(getans(ans)){         flag1=1;         break;         }         mr=atoi(ans);       if(r==mr)       break ;       else       printf("  %c\n",'X');       }        if(flag1){        printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'+',ti.b,r);        tinum--;       break ;       }       if(i<4&&r==mr){       rnum++;       printf("  %c\n",251);       }       else {       wnum++;       printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'+',ti.b,r);       }       }       break;       case '2':       for(j=0;j<5;j++){       get_ti(&ti,'2');       tinum++;       r=ti.a-ti.b;       for(i=1;i<4;i++){       if(i==1)       printf("\n(%d)%d. %2d%c%2d=",j+1,i,ti.a,'-',ti.b);       else         printf("\n%4d. %2d%c%2d=",i,ti.a,'-',ti.b);        if(getans(ans)){         flag1=1;         break;         }         mr=atoi(ans);       if(r==mr)       break ;       else       printf("  %c\n",'X');       }        if(flag1){        printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'+',ti.b,r);        tinum--;       break ;       }       if(i<4&&r==mr){       rnum++;       printf("  %c\n",251);       }       else {       wnum++;       printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'-',ti.b,r);       }       }       break;       case '3':       for(j=0;j<5;j++){       get_ti(&ti,'3');       tinum++;       r=ti.a*ti.b;       for(i=1;i<4;i++){       if(i==1)       printf("\n(%d)%d. %2d%c%2d=",j+1,i,ti.a,'*',ti.b);       else         printf("\n%4d. %2d%c%2d=",i,ti.a,'*',ti.b);        if(getans(ans)){         flag1=1;         break;         }         mr=atoi(ans);       if(r==mr)       break ;       else       printf("  %c\n",'X');       }        if(flag1){        printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'+',ti.b,r);        tinum--;       break ;       }       if(i<4&&r==mr){       rnum++;       printf("  %c\n",251);       }       else {       wnum++;       printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'*',ti.b,r);       }       }       break;       case '4':       for(j=0;j<5;j++){       get_ti(&ti,'4');       tinum++;       r=ti.a/ti.b;       for(i=1;i<4;i++){       if(i==1)       printf("\n(%d)%d. %2d%c%2d=",j+1,i,ti.a,'/',ti.b);       else         printf("\n%4d. %2d%c%2d=",i,ti.a,'/',ti.b);        if(getans(ans)){         flag1=1;         break;         }         mr=atoi(ans);       if(r==mr)       break ;       else       printf("  %c\n",'X');       }        if(flag1){        printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'+',ti.b,r);        tinum--;       break ;       }       if(i<4&&r==mr){       rnum++;       printf("  %c\n",251);       }       else {       wnum++;       printf("\n\nRight Ans: %2d%c%2d=%3d",ti.a,'/',ti.b,r);       }       }       break;       case '5':       break;       case 27:        printf("\n\nTotal %2d TiMu.",tinum);        if(tinum){ printf("\nRight %2d ti.",rnum); rate=(float)rnum/tinum; printf("\nRight rate %.2f%",rate*100); }     flag=1;       }   /*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa*/       if(flag) {       flag=0;       break;       }       }   /*------------------------------*/  break; /*****************************/ case '2':         tinum=0;        rnum=0;        wnum=0;        flag=0;     for(i=0;i<N;i++){        m2=rand()%4+49;      switch (m2){      /*111111111111111111111111*/       case '1':       get_ti(&test_ti[i],'1');       r=test_ti[i].a+test_ti[i].b;       test_ti[i].rr=r;       printf("\n%2d%c%2d=",test_ti[i].a,'+',test_ti[i].b);         if(getans(ans)){         flag=1;         break;         }         mr=atoi(ans);       test_ti[i].mr=mr;       if(r==mr){       rnum++;        tinum+=10;        }       else       wnum++;       break;       /*222222222222222222222222*/       case '2':       get_ti(&test_ti[i],'2');       r=test_ti[i].a-test_ti[i].b;       test_ti[i].rr=r;       printf("\n%2d%c%2d=",test_ti[i].a,'-',test_ti[i].b);         if(getans(ans)){         flag=1;         break;         }         mr=atoi(ans);       test_ti[i].mr=mr;       if(r==mr){       rnum++;        tinum+=10;        }       else       wnum++;       break;       /*333333333333333333333333333*/       case '3':       get_ti(&test_ti[i],'3');       r=test_ti[i].a*test_ti[i].b;       test_ti[i].rr=r;       printf("\n%2d%c%2d=",test_ti[i].a,'*',test_ti[i].b);         if(getans(ans)){         flag=1;         break;         }         mr=atoi(ans);       test_ti[i].mr=mr;       if(r==mr){       rnum++;        tinum+=10;        }       else       wnum++;       break;        /*4444444444444444444444444444*/       case '4':       get_ti(&test_ti[i],'4');       r=test_ti[i].a/test_ti[i].b;       test_ti[i].rr=r;       printf("\n%2d%c%2d=",test_ti[i].a,'/',test_ti[i].b);         if(getans(ans)){         flag=1;         break;         }         mr=atoi(ans);       test_ti[i].mr=mr;       if(r==mr){       rnum++;        tinum+=10;        }       else       wnum++;       break;       /*555555555555555555555555*/       case '5':       break;       }       if(flag){       flag=0;       break;       }       } /*end for(i=0;i<N;i++)*/       printf("\n\n\nTest result: Do %2d TiMu  score %2d",i,tinum);     if(i){       printf("\n\n  Right  TiMu %2d\n",rnum);       for(j=0;j<i;j++){       if(test_ti[j].rr==test_ti[j].mr){printf("\n%2d%c%2d=%3d    %c",test_ti[j].a,test_ti[j].o,test_ti[j].b,test_ti[j].rr,251);printf("     +10\n");}}printf("\nPress any key...");getch();if(rnum!=i){   printf("\n\n  Wrong TiMu %2d\n",wnum);for(j=0;j<i;j++){      if(test_ti[j].rr!=test_ti[j].mr){printf("\nYour answer  %2d%c%2d=%3d   %c",test_ti[j].a,test_ti[j].o,test_ti[j].b,test_ti[j].mr,'X');printf("\nRight answer %2d%c%2d=%3d\n",test_ti[j].a,test_ti[j].o,test_ti[j].b,test_ti[j].rr);}}printf("\nPress any key...");getch();}/*end if(rnum!=i)*/}/*end if(i)*/  break;  /*****************************/ case 27: exit(0); }/*end switch (m1){ 1 */} /*end while(1){ 1 */}