1、任务一:#include#include#includemain()int magic1,magic2,m,n;char reply;srand(time(NULL);domagic1=rand()%10+1;magic2=rand()%10+1;n=magic1*magic2;doprintf(%d*%d=m,input m=n,magic1,magic2);scanf(%d,&m);if(m!=n)printf(Wrong!please try again.n);elseprintf(Right!n);while(m!=n);printf(Do you want to continue(Y
2、/N or y/n)?);scanf( %c,&reply);while(reply=Y|reply=y);任务二:任务三:#include#include#includemain()int magic1,magic2,m,n,score,counter;srand(time(NULL);counter=0;score=0;domagic1=rand()%10+1;magic2=rand()%10+1;n=magic1*magic2;printf(%d*%d=m,input m=n,magic1,magic2);scanf(%d,&m);counter+;if(m!=n)printf(Wron
3、g!please try again.n);elseprintf(Right!n); score+;while(counter10);printf( 总分为%d,正确率为%d%,score*10,(score%10)*10);任务四:#include#include#includevoid main()int magic1,magic2,counter,score,t;float m,n;char a;srand(time(NULL);counter=0;score=0;domagic1=rand()%10+1;magic2=rand()%10+1;t=rand()%4;if(t=0) a=+;n=magic1+magic2; if(t=1) a=-;n=magic1-magic2; if(t=2) a=*;n=magic1*magic2; if(t=3) a=/;n=magic1/magic2;printf(%d%c%d=m,input m= ,magic1,a,magic2);scanf(%f,&m);counter+;if(m!=n)printf(wrong!n);elseprintf(Right!n);score+;while(counter10);printf(总分为%d,正确率为%d%,score*10,(score%10)*10);