《小学生计算机辅助教学系统试题.pdf》由会员分享,可在线阅读,更多相关《小学生计算机辅助教学系统试题.pdf(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、 word 文档 可自由复制编辑 任务一:#include#include#include main()int magic1,magic2,m,n;char reply;srand(time(NULL);do magic1=rand()%10+1;magic2=rand()%10+1;n=magic1*magic2;do printf(%d*%d=m,input m=n,magic1,magic2);scanf(%d,&m);if(m!=n)printf(Wrong!please try again.n);else printf(Right!n);while(m!=n);printf(Do y
2、ou want to continue(Y/N or y/n)?);scanf(%c,&reply);while(reply=Y|reply=y);任务二:word 文档 可自由复制编辑 任务三:#include#include#include main()int magic1,magic2,m,n,score,counter;srand(time(NULL);counter=0;word 文档 可自由复制编辑 score=0;do magic1=rand()%10+1;magic2=rand()%10+1;n=magic1*magic2;printf(%d*%d=m,input m=n,ma
3、gic1,magic2);scanf(%d,&m);counter+;if(m!=n)printf(Wrong!please try again.n);else printf(Right!n);score+;while(counter10);printf(总分为%d,正确率为%d%,score*10,(score%10)*10);word 文档 可自由复制编辑 任务四:#include#include#include void main()int magic1,magic2,counter,score,t;float m,n;char a;srand(time(NULL);counter=0;
4、score=0;do magic1=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);else printf(Right!n);score+;while(counter10);printf(总分为%d,正确率为%d%,score*10,(score%10)*10);word 文档 可自由复制编辑