设计一个小学生数学运算的测试方案。

# include & ltstdlib.h & gt

# include & ltstdio.h & gt

# include & lttime.h & gt

#包含“conio.h”

int sum

int rnd0(int x1,int x2)

{ int r;静态int n = 1;

r =随机(3);

开关(右)

{ case 0:printf("%d)%d+%d= ",n++,x1,x2);打破;

case 1:printf("%d)%d-%d= ",n++,x1,x2);打破;

情况二:printf("%d)%d*%d= ",n++,x1,x2);打破;

}

return r;

}

int rnd1()

{ int r;

r = random(10);

return r;

}

int rnd2()

{ int r;

r = random(10);

return r;

}

int crut(int x1,int fh,int x2)

{ int asn

开关(fh)

{案例0:ASN = x 1+x2;打破;

案例1:ASN = x 1-x2;打破;

情况二:ASN = x 1 * x2;打破;

}

返回asn

}

int vs(int m1,int m2)

{ int r,zq;r =随机(3);

if(m 1 = = m2){ zq = 1;

开关(右)

{case 0: printf("非常好!");打破;

案例1: printf("太棒了!");打破;

案例二:printf(“继续说好话!”);打破;

}

}

else { zq = 0;

开关(右)

{case 0: printf("No。请重试”);打破;

案例1: printf("错误再试一次");打破;

案例二:printf("不继续尝试");打破;

}

}

getch();clr SCR();返回zq;

}

主()

{ int x1,x2,ans,cru,js,tj,I;

int fh

Ld:printf("输入主题数(1-10):");

scanf("%d ",& ampTT);如果(TT & lt;0 | | TT & gt;10) {printf("请重新输入\ n ");getch();clr SCR();

goto ld}

randomize();

for(I = 1;我& lt= TT;i++)

{

x 1 = rnd 1();

x2 = rn D2();

fh=rnd0(x1,x2);

scanf("%d ",& ampans);cru=crut(x1,fh,x2);

js=vs(ans,cru);

sum+= js;

}

tj =总和/TT * 100;

Printf("精度:% d% \ n ",TJ);

if(TJ & lt;75)

printf("请向你的导师fope寻求额外帮助");

getch();

}