请帮我看一下有错的地方哪里有问题?谢谢!
#include"stdio.h"#include"time.h"
#include"conio.h"
#include"stdlib.h"
int main(void)
{
void add();
void subt();
void mult();
void divid();
void question(int,int,char);
void voice();
void clrscr();
void random();
int x=30,y=6;
char choice;
void randomize();
while(1)
{
clrscr();
gotoxy(x,y);puts("1.加法练习:"); --------------------有错
gotoxy(x,y+1);puts("2.减法训练");
gotoxy(x,y+2);puts("3.乘法训练");
gotoxy(x,y+3);puts("4.除法训练");
gotoxy(x,y+4);puts("5.退 出");
gotoxy(x,y+6);puts("请选择(1,2,3,4,5):");
choice=getch();
switch(choice)
{
case'1':add();break;
case'2':subt();break;
case'3':mult();break;
case'4':divid();break;
case'5':exit(0);break;
default:printf("输入有误!按任意键后重新输入......");
getch();
}
}
}
void add();
{ ---- ------------------------------------------------有错
int i,num1,num2,answer;
void clrscr();
for(i=1;i<=5;i++)
{
num1=random(99)+1;
num2=random(99)+1;
question(num1,num2,'+');
scanf("%d",&answer);
if(answer==num1+num2)
puts("正确!");
else
{
void voice();
printf("错了,正确答案是:%d/n",num1+num2);
}
}
printf("\n加法练习做完了,按任意键返回菜单......");
getch();
}
void subt();
{ ---------------------------------------有错
int i,num1,num2,answer;
clrscr();
for(i=1;i<=5;i++)
{
num1=random(99)+1;
num2=random(99)+1;
question(num1,num2,'-');
scanf("%d",&answer);
if(answer==num1-num2)
puts("正确!");
else
{
voice();
printf("错了,正确答案是:%\b",num1=num2);
}
}
printf("\n减法练习做完了,按任意键返回菜单......");
getch();
}
void mult();
{ ---------------------------------------有错
int i,num1,num2,answer;
clrscr();
for(i=1;i<=5;i++)
{
num1=random(99)+1;
num2=random(10);
question(num1,num2,'*');
scanf("%d",&answer);
if(answer==num1*num2)
puts("正确!");
else
{
voice();
printf("错了,正确答案是:%d\n",num1+num2);
}
}
printf("\n乘法练习做完了,按任意键返回菜单......");
getch();
}
void divid();
{ -----------------------------------有错
i,num1,num2,answer;
clrscr();
for(i=1;i<=5;i++)
{
do
{
num1=random(99)+1;
num2=random(9)+1;
}while(num1%num2!=0);
void question(num1,num2,'/');
scanf("%d",&answer);
if(answer==num1/num2)
puts("正确!");
else{
void voice();
printf("错了,正确答案是:%d\n",num1/num2);
}
}
printf("\n除法做完了,按任意键返回菜单......");
getch();
}
void question(int n1,int n2,char opt);
{ --------------------------------------------------有错
printf("%d%c%d=",n1,opt,n2);
}
void voice();
{ -----------------------------------------------------有错
int i;
for(i=1;i<=3;i++)
{
void sound(i*1000);
void delay(200);
void nosound();
}
} --------------------------------------------------------有错