用C语言编一个小学算术运算测试程序

功能要求:制作一个可供小学数学运算程序:10以内加减法,能根据输入题数出题,判断做题是否正确,最后计算分数。
界面要求:美观简洁
每一步后写明注释
例如:输入5,即表明出五道题。
如果能讲清楚每一步的意思,我会再追加分数的.

能根据输入题数出题 什么意思
有个题库?
界面要求:美观简洁 什么标准
作者满意就可?

实现起来应该不难
晚上9点以后我可以帮你做

好办 我帮你写吧 能否多给点分呢 (*^__^*) 嘻嘻……
晚上10点前给你答案

花了一个中午给你编的,还增加了计算分数功能
界面没有做 需要的话再联系
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int Getanum(int num)
{
int a;
srand(num*num+time(0));
a=(rand()+num)%10;//产生10以内的随机数
return a;
}

void main()
{
int i,num,a,b,c,op,error;
error = 0;//错误数置零
num = 100;//使得下面的while循环成立即可
while(!(num>0&&num<10))//只接受10以内的题目数
{
printf("Please input the sum of exam :");
scanf("%d",&num);
}
for(i=0;i<num;i++)//每次出题开始
{
a = Getanum(i);//第一个操作数
b = Getanum(a);//第二个
op = (Getanum(a+b)+b)/a%2;//产生符号 +或者-
switch(op)
{
case 0://+
if(a+b>10)//超过10重新来
{
i--;
break;
}
else
{
printf("%d : %d + %d = ",i+1,a,b);//出题
scanf("%d",&c);//取输入的结果
if(c != a+b)//答案错误
{
printf("Error!\n");
error++;
}
else//正确答案鼓励一下
{
printf("Good!\n");
}
}
break;

case 1://-
if(b>a)//保证a>b 使得不出现负数
{
a=a+b;
b=a-b;
a=a-b;
}
printf("%d : %d - %d = ",i+1,a,b);//出题
scanf("%d",&c);//取结果
if(c != a-b)
{
printf("Error!\n");
error++;//错误自加
}
else
{
printf("Good!\n");
}
break;

default:
break;
}
}
printf("%d errors!\n",error);//输出错误数
printf("Your mark is %d .\n",(num-error)*100/num);//所得分数
}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-12-17
能根据输入题数出题
什么意思
有个题库?
界面要求:美观简洁
什么标准
作者满意就可?
实现起来应该不难
晚上9点以后我可以帮你做
好办
我帮你写吧
能否多给点分呢
(*^__^*)
嘻嘻……
晚上10点前给你答案
花了一个中午给你编的,还增加了计算分数功能
界面没有做
需要的话再联系
#include
<stdio.h>
#include
<stdlib.h>
#include
<time.h>
int
Getanum(int
num)
{
int
a;
srand(num*num+time(0));
a=(rand()+num)%10;//产生10以内的
随机数
return
a;
}
void
main()
{
int
i,num,a,b,c,op,error;
error
=
0;//错误数置零
num
=
100;//使得下面的while循环成立即可
while(!(num>0&&num<10))//只接受10以内的题目数
{
printf("Please
input
the
sum
of
exam
:");
scanf("%d",&num);
}
for(i=0;i<num;i++)//每次出题开始
{
a
=
Getanum(i);//第一个操作数
b
=
Getanum(a);//第二个
op
=
(Getanum(a+b)+b)/a%2;//产生符号
+或者-
switch(op)
{
case
0://+
if(a+b>10)//超过10重新来
{
i--;
break;
}
else
{
printf("%d
:
%d
+
%d
=
",i+1,a,b);//出题
scanf("%d",&c);//取输入的结果
if(c
!=
a+b)//答案错误
{
printf("Error!\n");
error++;
}
else//正确答案鼓励一下
{
printf("Good!\n");
}
}
break;
case
1://-
if(b>a)//保证a>b
使得不出现负数
{
a=a+b;
b=a-b;
a=a-b;
}
printf("%d
:
%d
-
%d
=
",i+1,a,b);//出题
scanf("%d",&c);//取结果
if(c
!=
a-b)
{
printf("Error!\n");
error++;//错误自加
}
else
{
printf("Good!\n");
}
break;
default:
break;
}
}
printf("%d
errors!\n",error);//输出错误数
printf("Your
mark
is
%d
.\n",(num-error)*100/num);//所得分数
}
第2个回答  2019-04-27
能根据输入题数出题
什么意思
有个题库?
界面要求:美观简洁
什么标准
作者满意就可?
实现起来应该不难
晚上9点以后我可以帮你做
好办
我帮你写吧
能否多给点分呢
(*^__^*)
嘻嘻……
晚上10点前给你答案
花了一个中午给你编的,还增加了计算分数功能
界面没有做
需要的话再联系
#include
<stdio.h>
#include
<stdlib.h>
#include
<time.h>
int
Getanum(int
num)
{
int
a;
srand(num*num+time(0));
a=(rand()+num)%10;//产生10以内的随机数
return
a;
}
void
main()
{
int
i,num,a,b,c,op,error;
error
=
0;//错误数置零
num
=
100;//使得下面的while循环成立即可
while(!(num>0&&num<10))//只接受10以内的题目数
{
printf("Please
input
the
sum
of
exam
:");
scanf("%d",&num);
}
for(i=0;i<num;i++)//每次出题开始
{
a
=
Getanum(i);//第一个操作数
b
=
Getanum(a);//第二个
op
=
(Getanum(a+b)+b)/a%2;//产生符号
+或者-
switch(op)
{
case
0://+
if(a+b>10)//超过10重新来
{
i--;
break;
}
else
{
printf("%d
:
%d
+
%d
=
",i+1,a,b);//出题
scanf("%d",&c);//取输入的结果
if(c
!=
a+b)//答案错误
{
printf("Error!\n");
error++;
}
else//正确答案鼓励一下
{
printf("Good!\n");
}
}
break;
case
1://-
if(b>a)//保证a>b
使得不出现负数
{
a=a+b;
b=a-b;
a=a-b;
}
printf("%d
:
%d
-
%d
=
",i+1,a,b);//出题
scanf("%d",&c);//取结果
if(c
!=
a-b)
{
printf("Error!\n");
error++;//错误自加
}
else
{
printf("Good!\n");
}
break;
default:
break;
}
}
printf("%d
errors!\n",error);//输出错误数
printf("Your
mark
is
%d
.\n",(num-error)*100/num);//所得分数
}
第3个回答  2008-09-02
还界面美观简洁!你说的可真好听!
一分不给,还这么多要求!
第4个回答  2008-09-02
要delphi不 我给你快速开发

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网