C语言课程设计,小学算术运算测试系统模拟,求大概思路以及具体的程序代码。网上没现成的,按具体的任务来

作者&投稿:衅虞 (若有异议请与网页底部的电邮联系)
C语言程序设计报告 1、小学算术运算测试(math.c)~

#include
#include
#include
main()
{
int i,n,fen=0,p;
int a,b,num;
printf("请输入题目数目:");
scanf("%d",&n);
srand(time(0));
for(i=0;i<n;i++)
{ a=rand()%100;
b=rand()%100;
p=rand()%3;

if(p==0)
{ printf("%d + %d = ",a,b);
scanf("%d",&num);
if(num==a+b)fen++;
}

if (p==1)

{ printf("%d - %d = ",a,b);
scanf("%d",&num);
if(num==a-b)fen++;
}

if (p==2)

{ printf("%d * %d = ",a,b);
scanf("%d",&num);
if(num==a*b)fen++;
}
if (p==3&&b!=0)
{ printf("%d/%d = ",a,b);
scanf("%d",&num);
if(num==a/b)fen++;
}
if(p==3&&b==0)
return n-1;
}
printf("总分 %d,得分%d ",n,fen);
if(fen<(0.8*n))
printf("继续努力,加强练习!
");
if(fen>=(0.8*n))
{if(fen==n)
printf("棒极了!
");}
else printf("请保持!
");
}

好嘛,我帮帮忙。

代码如下,测试可运行,不过没蜂鸣就是了
#include <stdio.h>
#include <time.h>
#include <stdlib.h>

int question(int number)//100以内的加减法
{
int i,j,k,answer,realAnswer;//i,j为被加被减数,k为运算符(通过模2)
char opper;
srand((unsigned)time(NULL));
i=rand()%100;
j=rand()%100;
k=rand()%2;
if(k) opper='+';
else opper='-';
if(i<j&&opper=='-')
{
int temp;
temp=i;
i=j;
j=temp;
}

if(opper=='+')
realAnswer=i+j;
else
realAnswer=i-j;
printf("No.%d: %d%c%d=",number,i,opper,j);
scanf("%d",&answer);
if(answer==realAnswer)
return 1;//正确则返回1
else
{
printf("答案错误,正确答案为%d\n",realAnswer);
return 0;
}
}

int main()
{
int number,i,rightNum=0,wrongNum=0;
float score;
printf("请输入题目个数:\n");
scanf("%d",&number);
i=number;
while(i)
{
rightNum+=question(number-i+1);
i--;
}
wrongNum=number-rightNum;
score=100*((float)rightNum/(float)number);
printf("算对%d题,算错%d题,总得分为%.2f\n",rightNum,wrongNum,score);
system("pause");
}

我的可以计算,加减乘除。自选。 计算的最大值100 可以自选。默认是0-50以内。可以自己设置。

你是要代码? 还是要可以直接运行的程序?



#include "stdio.h"
#include "time.h"
#include "stdlib.h"

struct timu
{
int num1;
int num2;
char fuhao;
int right;
int yu;
int yu_r;
int daan;
}std[5];

main()
{
int i,n=0,cj=0;
char fh[4]="+-*/";
system("cls");
srand((unsigned long)time(0));
for(i=0;i<5;i++)
{
std[i].num1=rand()%100;
std[i].num2=rand()%100;
std[i].fuhao=fh[rand()%4];
while((std[i].fuhao=='/')&&((std[i].num2==0)||(std[i].num2>std[i].num1)))
{
std[i].num2=rand()%100;
}
while(std[i].fuhao=='-'&&std[i].num2>std[i].num1)
{
std[i].num2=rand()%100;
}
printf("%d %c %d = ",std[i].num1,std[i].fuhao,std[i].num2);
switch(std[i].fuhao)
{
case '+':std[i].right=std[i].num1+std[i].num2;break;
case '-':std[i].right=std[i].num1-std[i].num2;break;
case '*':std[i].right=std[i].num1*std[i].num2;break;
case '/':std[i].right=std[i].num1/std[i].num2;std[i].yu=std[i].num1%std[i].num2;break;
}
if((std[i].fuhao=='/')&&(std[i].yu!=0))
scanf("%d%d",&std[i].daan,&std[i].yu_r);
else
{
std[i].yu_r=0;
scanf("%d",&std[i].daan);
}
if(std[i].daan==std[i].right&&std[i].yu==std[i].yu_r)
n++;
cj=n*10;
printf("\n当前成绩:%d\n\n",cj);
}
printf("\n\n总成绩:%d\n",cj);
for(i=0;i<5;i++)
{
if((std[i].fuhao=='/')&&(std[i].yu!=0))
printf("\n%d. %d %c %d = %d %d\n\t您的答案:d %d\n",i+1,std[i].num1,std[i].fuhao,std

[i].num2,std[i].right,std[i].yu_r,std[i].daan,std[i].yu);
else
printf("\n%d. %d %c %d = %d\n\t您的答案:%d\n",i+1,std[i].num1,std[i].fuhao,std[i].num2,std

[i].right,std[i].daan);
}
getch();
}


C语言课程设计~~~ 要求编写一段程序,题目是《校际运动会管理系统...
我这是源代码已经调试过了,在VC++上运行成功了。include "stdio.h" \/*I\/O函数*\/ include "stdlib.h" \/*其它说明*\/ include "string.h" \/*字符串函数*\/ include "conio.h" \/*屏幕操作函数*\/ include "mem.h" \/*内存操作函数*\/ include "ctype.h" \/*字符操作函数*\/...

C语言课程设计
经过琢磨,听师姐,年长的学生的建议,但也获得了大量的书籍,和它做了一个不错的主意,不知道的真实意图 - 培养自学能力,一个良好的习惯开发一个程序来编辑C语言课程设计。我从来不相信车到山前必有路,他说,只是懒惰找借口偷懒的,我想是积极的,要把握一定要努力。 课程设计审查以来,到目前为止,我仍然感觉了很多,...

c语言课程设计求助 学生管理系统 要求:1.可输入学生学号、姓名、性别...
printf("请输入第%d个学生的三门课程成绩:", i + 1);for(j = 0; j < 3; j++)scanf("%d", &stu[i].stuscore[j]);printf("\\n");} \/\/输出,此处同样为了简略只输出3个。可以自己改成1个哦 printf("前3个学生3门课成绩如下:\\n");for(i = 0; i < 3; i++) { printf(...

c语言课程设计
我要一个完整的课程设计,三选一即可,等我那号分转过来,再加200,内容如下:1、学生成绩管理(结构体数组、函数、指针、算法、流程结构及文件等的综合应用)程序说明:有N个学生,每... 我要一个完整的课程设计,三选一即可,等我那号分转过来,再加200,内容如下:1、学生成绩管理(结构体数组、函数、指针、算法、...

关于C语言的课程设计,急呀,请各位大虾帮帮忙啊,都快哭死了
关于C语言的课程设计,急呀,请各位大虾帮帮忙啊,都快哭死了 学生成绩管理系统设计学生成绩信息包括:学号,姓名,三门课程成绩(语文、数学、英语)、总分。主要功能:1、学生信息录入功能(学生信息用文件保存)--输入;2、计算每个同学的总分... 学生成绩管理系统设计学生成绩信息包括:学号,姓名,三门课程成绩(语文、...

c语言课程设计之学生成绩管理系统设计的程序
printf("输入课程1名称:");scanf("%s",frist[0].name);fprintf(p,"%s\\n",frist[0].name);printf("输入课程2名称:");scanf("%s",frist[1].name);fprintf(p,"%s\\n",frist[1].name);printf("输入课程3名称:");scanf("%s",frist[2].name);fprintf(p,"%s\\n",frist[2].name);}...

...课程标准2001年版。语文基础知识和基本技能,小学语文教材教法及教学...
语文课程评价的目的不仅是为了考察学生达到学习目标的程度,更是为了检验和改进学生的语文学习和教师的教学,改善课程设计,完善教学过程,从而有效地促进学生的发展。不应过分强调评价的甄别和选拔功能。 突出语文课程评价的整体性和综合性,要从知识与能力、过程与方法、情感态度与价值观几方面进行评价,以全面考察学生的语文...

C语言课程设计:学生学籍管理系统。有谁有代码给我做个参考吗?谢谢了...
include<stdio.h> include<string.h> include<stdlib.h> typedef struct stud \/\/学生信息结构 { long num;char name[20];float score;}Stud;typedef struct node { Stud student;struct node *next;}Node;Node *head=NULL;void read(void);void inser(long b);void print();void find(long b...

C语言程序设计课程设计报告怎么写啊?有谁有样本吗?谢啦!
实 验 报 告 一 课 程 C语言程序设计 实验项目 C程序设计初步 成 绩 专业班级 学 号 指导教师 金发夏 姓 名 序 号 实验日期 一【实验目的】1. 了解使用VC++6.0的开发环境;2. 掌握在该系统上如何编辑、编译、连接和运行一个C程序;3. 通过运行简单的C程序,初步了解...

C语言课程设计
C语言课程设计 题目商品信息管理程序设计一个商品信息管理程序,商品信息包括:商品编号,商品名称,商品价格,商品数量,商品生产商等。该程序设计应该具有以下功能:1商品信息的添加2商品信息的删... 题目 商品信息管理程序 设计一个商品信息管理程序,商品信息包括:商品编号,商品名称,商品价格,商品数量,商品生产商等。该...

渭滨区15057153178: C语言设计小学算术运算测试. -
堵郑普罗: Please input question total:478 - 70 = 8 Right!59 - 34 = 25 Right!82 + 92 = 11 Wrongthe answer is [174].52 + 53 = 105 Right!there are 4 Questions,Right 3,Wrong 1.Score is 75.0.Press any key to continue#include <stdio.h>#include <stdlib.h>#...

渭滨区15057153178: 利用C语言开发一个小学生算术四则运算测试系统 -
堵郑普罗: /************************************ CopyRight Dragonpaopao************************************/#include <stdlib.h>#include <stdio.h>#include <time.h> int question_get(); int type; void main( void ) { int answer;srand( (unsigned)time( NULL ) ); printf( "...

渭滨区15057153178: 用C语言制作一个小学算术运算测试 -
堵郑普罗: #include <stdio.h>#include <stdlib.h>#define ExerNumber 10 /*每轮题目数 */ void test() { int algtype = 0; /*计算类型 */ int i, /*for的循环控制变量 */ points = 0, /*成绩 */ num1[10], num2[10], /*两个操作数 */ result[10], /*程序的计算结果 */ answer ...

渭滨区15057153178: 小学生算术运算考试系统(利用C语言编写) 请看清下面的要求 谢谢......... -
堵郑普罗: #include <stdio.h>#include <time.h>#include <stdlib.h> int cal(int, int, int); void main(void) { int sel=3,sym=0,op1=0, op2=0, op3=0,op4=0; int cnt=0,err=0; srand((int)time(NULL)); do{ sym = rand()%4; op1 = rand()%10;op2 = rand()%10; op3 = rand()...

渭滨区15057153178: 用C语言编写一个简单的"小学数学测试系统" -
堵郑普罗: include <stdio.h> /* 调用库函数 */ #include <stdlib.h> /* 调用库函数 */ int Tha; /* 变量 表示第一个运算数 */ int Thb; /* 第二个运算数 */ int Tresult; /* 正确答案 */ int Qcount; /* 题目的个数 */ int Upnum; /* 升级的分数 */ int Tscore; /* 当前得分 ...

渭滨区15057153178: C语言课程设计 - ---算术练习 -
堵郑普罗: /*头函数*/ #include <stdio.h> #include <stdlib.h> #include <time.h> /*全局变量*/ int n_test=10,division=10;/*测验题数与题目位数参数的缺省值*/ int num=0;/*测验人数*/ /*结构体*/ struct student_type { char name[10]; int record; }stud[30]; /*模块......

渭滨区15057153178: c语言课程设计
堵郑普罗: #include<iostream> using namespace std; #define N 20 #include<time.h> int rand(int n1,int n2) { if (n1>n2) return -1; if (n1==n2) return 0; int temp=n1+int((n2-n1)*double(rand())/RAND_MAX); return temp; } void main() { srand( (unsigned)time( ...

渭滨区15057153178: 用C语言程序编写一个能运算20以内的加减乘除的小学算术测试程序(要求大概要120行左右)急用!!!谢谢! -
堵郑普罗: 这个比较短但还能用,求给分呀 void main() {float x,y; char c; do { printf("input x(+,-,*,/)y\n"); scanf("%f%c%f",&x,&c,&y); switch(c) {case '+': printf("%f\n",x+y);break; case '-': printf("%f\n",x-y);break; case '*': printf("%f\n",x*y);break; case '/'...

渭滨区15057153178: 如何用c++编写一个小学生数学测试系统 -
堵郑普罗: //#include #include using namespace std; int main() { int i,j,k,l=0,n; couti; if(i==1) { cout>j; for(int k1=0;k1>k; if(k==x1+x2){ coutj; for(int k1=0;k1>k; if(k==x2-x1){ coutj; for(int k1=0;k1>k; if(k==x1*x2){ coutj; for(int k1=0;k1>k; if(k==x2/x1){ coutn; if(n==1){ return main();} // system("PAUSE"); return 0; }

渭滨区15057153178: c语言小学算术运算测试 -
堵郑普罗: #include #include #define MAXNUM 10 main() { int a,b,i,j=0; int num,inputsum; int arraysum[MAXNUM]; double present; printf("please input number\n"); scanf("%d",&num); srand((unsigned)time(NULL)); for (i=0;i { a=rand()%10; b=rand()%10; ...

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