小学生计算机辅助教学系统试题

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

任务一:#includetime.h#includestdlib.h#includestdio.hmain(){intmagic1,magic2,m,n;charreply;srand(time(NULL));do{magic1=rand()%10+1;magic2=rand()%10+1;n=magic1*magic2;do{printf(%d*%d=m,inputm=\n,magic1,magic2);scanf(%d,&m);if(m!=n)printf(Wrong!pleasetryagain.\n);elseprintf(Right!\n);}while(m!=n);printf(Doyouwanttocontinue(Y/Nory/n)?);scanf(%c,&reply);}while(reply=='Y'||reply=='y');}任务二:任务三:#includetime.h#includestdlib.h#includestdio.hmain(){intmagic1,magic2,m,n,score,counter;srand(time(NULL));counter=0;score=0;do{magic1=rand()%10+1;magic2=rand()%10+1;n=magic1*magic2;printf(%d*%d=m,inputm=\n,magic1,magic2);scanf(%d,&m);counter++;if(m!=n)printf(Wrong!pleasetryagain.\n);else{printf(Right!\n);score++;}}while(counter10);printf(总分为%d,正确率为%d%%,score*10,(score%10)*10);}任务四:#includetime.h#includestdlib.h#includestdio.hvoidmain(){intmagic1,magic2,counter,score,t;floatm,n;chara;srand(time(NULL));counter=0;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,inputm=,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);}

1 / 5
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功