C程序课程设计题目:小学生计算机辅助教学系统。 详情如下,望各位高手帮忙给出源代码!

C程序课程设计题目:小学生计算机辅助教学系统。 详情如下,望各位高手帮忙给出源代码!,第1张

#include <stdioh>
#include <stdlibh>
#include <timeh>
void main()
{
int a,b,op,term;
int x,i=0;
int counter = 0; /初始答对题数为0/
char opchar;
srand(time(NULL)); /为函数rand()设置随机数种子/
a= rand()%10+1;
b= rand()%10+1;
for(i= 0;i < 10;i++)
{
a= rand()%10+1;
b= rand()%10+1;
op=rand()%4+1;
switch(op) /根据运算符号不同进行不同的运算/
{
case1:opchar='+';
term=a+ b;
break;
case2: opchar='-';
term=a - b;
break;
case3: opchar='';
term=a
b;
break;
case
4:
opchar='/';
term=a/b;
break;
default:
printf("Wrong
operator!");
}
printf("%d%c%d=",a,opchar,b);
scanf("%d",&x);
if(x==term)
{
printf("Right!\n");
counter++;
}
else
printf("Wrong!\n");
}
printf("Total
score is %d\n",counter10);
printf("Rate
of correctness is %d%%\n",counter10);
}

以上就是关于C程序课程设计题目:小学生计算机辅助教学系统。 详情如下,望各位高手帮忙给出源代码!全部的内容,包括:C程序课程设计题目:小学生计算机辅助教学系统。 详情如下,望各位高手帮忙给出源代码!、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zz/9733327.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-01
下一篇2023-05-01

发表评论

登录后才能评论

评论列表(0条)

    保存