大一学妹..拜托大家了。帮我运行一下..找找错误好么。.....
#include<stdio.h>#include<stdlib.h>
#include<time.h>
#define N 5/*计算的次数*/
int zcd()/*主菜单函数*/
{
int i,a,b,c,d,m;/*a,b,c,d分别代表四个子菜单的开关*/
printf("*********欢迎使用小学生算术软件**********\n");
printf("1开始算术,0结束程序\n");
scanf("%d",&i);
if(i=1) printf("请选择您想完成的练习\n");
printf("a:加法练习! b:减法练习! c:乘法练习! d:除法练习!");
scanf("%d",&m);
if (m=a)
return(1);
if (m=b)
return(2);
if (m=c);
return(3);
if (m=d);
return(4);
}
void chuti() /*加法出题函数*/
{int X,Y,n,a;
X=1;
Y=20;
srand((unsigned)time(NULL)); /*随机种子*/
n=rand()%(Y-X+1)+X; /*n为X~Y之间的随机数*/
switch(n)
{case 1: {printf("11+23=\n");break;}
case 2: {printf("15+22=\n");break;}
case 3: {printf("18+9=\n");break;}
case 4: {printf("38+29=\n");break;}
case 5: {printf("21+3=\n");break;}
case 6: {printf("44+51=\n");break;}
case 7: {printf("2+6=\n");break;}
case 8: {printf("43+98=\n");break;}
case 9: {printf("56+12=\n");break;}
case 10: {printf("88+12=\n");break;}
case 11: {printf("2+96=\n");break;}
case 12: {printf("1+99=\n");break;}
case 13: {printf("54+21=\n");break;}
case 14: {printf("11+2=\n");break;}
case 15: {printf("54+9=\n");break;}
case 16: {printf("32+19=\n");break;}
case 17: {printf("77+32=\n");break;}
case 18: {printf("15+76=\n");break;}
case 19: {printf("25+65=\n");break;}
case 20: {printf("42+32=\n");break;}
}
}
main()
{ int i;
system("graftabl 936");
srand(time(NULL));
i=zcd();
if(i=1) jiafa();
printf("\n*******恭喜你通关完成*******\n");
printf("谢谢使用本软件,再见!!");
}
int jiafa(void)
{int n,X,Y,k,a;
for (k=0;k<=9;k++)
{chuti();
getch();
printf("请输入你的答案:");
scanf("%d",&a);
printf("%d",a);
} /*加法练习*/
}