哪位能帮忙编一个C语言小学运算题(谢谢)?

来源:百度知道 编辑:UC知道 时间:2024/06/06 05:15:37
我编了好久了,可就是有一些问题,编的不对?我都急了!
要求:10以内加减法,做题者能输入题数,根据题数出题,判断做题是否正确,最后计算分数。界面要美观!
哪位能解决的帮帮忙啊,先写过了!

给你写,先占个位.要包含10 吗?

界面你自己调一下,或给个大概图形,再找我。

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

main()
{
int i,j,score=0,answer;

int a,b;
randomize();
printf("Su ru ti shu:");
scanf("%d",&j);
for(i=0;i<j;i++){
a=random(10)+1;
b=random(10)+1;
if(a>=b){
printf("\n%d-%d=",a,b);
scanf("%d",&answer);
if(a-b==answer)
score++;
}
else {
printf("\n%d+%d=",a,b);

scanf("%d",&answer);

if(a+b==answer)
score++;

}
}

printf("Your score is %d",(int)((float)score/(float)j*100));

getch();
return 0;
}

给点分吧。。。

体力劳动

(1)3/5-1/4+3/5=? (2)4/15+9/20-3/10=? (3)18/20-(1/4+2/5)=? (4)5/8+7/12-4/9=? (5)17/18-(1/12+1/6)=? (6)1/2+1/4-1/8=?