标题:请帮我看一下有错的地方哪里有问题?谢谢!
只看楼主
陈哈
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2020-11-19
 问题点数:0 回复次数:2 
请帮我看一下有错的地方哪里有问题?谢谢!
#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();
    }
}    --------------------------------------------------------有错
搜索更多相关主题的帖子: printf answer puts void int 
2020-12-14 15:18
陈哈
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2020-11-19
得分:0 
谢谢各位大佬!!
2020-12-14 15:19
apull
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:三体星系
等 级:版主
威 望:185
帖 子:1404
专家分:8479
注 册:2010-3-16
得分:0 
main外面的几个错误太明显了,括号后面跟了个分号。
2020-12-14 16:49



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-504251-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.386368 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved