《小学生计算机辅助教学系统试题(共5页).doc》由会员分享,可在线阅读,更多相关《小学生计算机辅助教学系统试题(共5页).doc(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
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
2、to continue(Y/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!=
3、n)printf(Wrong!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、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);专心-专注-专业