用C语言遍的“100以内的整数四则运算测试程序设计”
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/08/23 08:38:45
用C语言遍的“100以内的整数四则运算测试程序设计”
(1)选项菜单集成各功能函数模块
(2)出题(每次出10道题目)
(3)答题并评分
(4)答错的题给出正确答案
(5)显示答卷
一次对已做过10道题进行测试,评分并给出正确答案!然后将以上所做的在运行时显示出来!
(1)选项菜单集成各功能函数模块
(2)出题(每次出10道题目)
(3)答题并评分
(4)答错的题给出正确答案
(5)显示答卷
一次对已做过10道题进行测试,评分并给出正确答案!然后将以上所做的在运行时显示出来!
答题时候输入整数
舍点小数部分.
#include
#include
#include
void main()
{
int i;long answer1[10],answer[10];float a[10]; char c[2],str[10];
void anser(float a[],char str[],long answer[]);
void show(long answer[]);
void answer2(long answer1[]);
int score(long answer[],long answer1[]);
do
{
printf("1 :show question\n");
printf("2 :answer the question\n");
printf("3 :show score\n");
printf("4 :show answer\n");
printf("5 :exit\n");
scanf("%d",&i);
switch(i)
{
case 1:anser(a,str,answer);break;
case 2:answer2(answer1);break;
case 3:printf("your socre is %d\n",score(answer,answer1));break;
case 4:show(answer);break;
case 5:break;
default:printf("bad input\n");
}
}while(i!=5);
}
void answer2(long answer1[])
{
int i;char c[2];
bb:
printf("please input your answer\n");
for(i=0;i
舍点小数部分.
#include
#include
#include
void main()
{
int i;long answer1[10],answer[10];float a[10]; char c[2],str[10];
void anser(float a[],char str[],long answer[]);
void show(long answer[]);
void answer2(long answer1[]);
int score(long answer[],long answer1[]);
do
{
printf("1 :show question\n");
printf("2 :answer the question\n");
printf("3 :show score\n");
printf("4 :show answer\n");
printf("5 :exit\n");
scanf("%d",&i);
switch(i)
{
case 1:anser(a,str,answer);break;
case 2:answer2(answer1);break;
case 3:printf("your socre is %d\n",score(answer,answer1));break;
case 4:show(answer);break;
case 5:break;
default:printf("bad input\n");
}
}while(i!=5);
}
void answer2(long answer1[])
{
int i;char c[2];
bb:
printf("please input your answer\n");
for(i=0;i