小学CAI教学辅助系统(c语言)??!!只要思路!!!!!

2021-04-03 教育 103阅读
以下是个小学生四则运算自动出题系统,可以检测答案是否正确
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#include
#include
#include
#include
int comp(int);
int init(void);
int main(int argc, char* argv[])
{
int in;
do
{
init();
scanf("%d",&in);
assert(in>=0&&in<=4);
system("cls");
if (in!=0) comp(in);
}
while (in!=0);
return 0;
}
int init(void)
{
system("cls");
printf("1. Addition\n2. Subtraction\n3. Multiplication\n4. Division\n0. EXIT\n");
return 0;
}
int comp(int op)
{
int a,b,c;
float cfd;
printf("Input \'-1\' to exit!\n\n");
srand(time(NULL));
cfd=(float)(a/b);
do
{
a=rand()%100+1;
b=rand()%100+1;
switch(op){
case 1:printf("%d+%d=",a,b);
b=a+b;
break;
case 2:while (a-b<0) {
a=rand()%100+1;
b=rand()%100+1;
}
printf("%d-%d=",a,b);
b=a-b;
break;
case 3:printf("%d*%d=",a,b);
b=a*b;
break;
case 4:while (aa=rand()%100+1;
b=rand()%100+1;
cfd=a/b;
}
printf("%d/%d=",a,b);
b=a/b;
break;
}
scanf("%d",&c);
b==c?printf("\nRight!\n"):printf("\nWrong! It's %d\n",b);
}while (c!=-1);
return 0;
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com