用C语言遍的“100以内的整数四则运算测试程序设计”
来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/08/13 17:35:29
用C语言遍的“100以内的整数四则运算测试程序设计”
(1)选项菜单集成各功能函数模块
(2)出题(每次出10道题目)
(3)答题并评分
(4)答错的题给出正确答案
(5)显示答卷
一次对已做过10道题进行测试,评分并给出正确答案!然后将以上所做的在运行时显示出来!
(1)选项菜单集成各功能函数模块
(2)出题(每次出10道题目)
(3)答题并评分
(4)答错的题给出正确答案
(5)显示答卷
一次对已做过10道题进行测试,评分并给出正确答案!然后将以上所做的在运行时显示出来!
![用C语言遍的“100以内的整数四则运算测试程序设计”](/uploads/image/z/8579105-17-5.jpg?t=%E7%94%A8C%E8%AF%AD%E8%A8%80%E9%81%8D%E7%9A%84%E2%80%9C100%E4%BB%A5%E5%86%85%E7%9A%84%E6%95%B4%E6%95%B0%E5%9B%9B%E5%88%99%E8%BF%90%E7%AE%97%E6%B5%8B%E8%AF%95%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1%E2%80%9D)
答题时候输入整数
舍点小数部分.
#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