这是为什么出错了呀??

img

整体修改后如下
其中函数调用的时候不需要在前面写void
有帮助望采纳~

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define WIDTH 40
#define MIDDLE 25
#define LEFT 5
#define SPACE ' '
#define SIGN '*'
void Menu(void);
void top_line(char ch);
void every_line(char * left, char * right);
void show_n_char(char ch,int num);
int Max(int a,int b);
void Add(void);
void Minus(void);
void Multiply(void);
void Divide(void);
void Mixed(void);
void main(void)
{
    int choice;
    Menu();
    printf("Please choose one number : ");
    scanf("%d",&choice);
    printf("\n");
    switch(choice)
    {
        case 1: Add();break;
        case 2: Minus();break;
        case 3: Multiply();break;
        case 4: Divide();break;
        case 5: Mixed();break;
        case 6: return;
        default: {printf("\n"),printf("Wrong! Please choose another true number!!\n"),printf("\n"),main();};
    }
    return 0;
}
void Menu(void)
{
    int spaces;
    int middle;
    const char * top = "THE MENU";
    const char * choice1 = "1.add(+)";
    const char * choice2 = "2.minus(-)";
    const char * choice3 = "3.multiply(*)";
    const char * choice4 = "4.divide(/)";
    const char * choice5 = "5.mixed ";
    const char * choice6 = "6.Exit";
    top_line(SIGN);
    top_line(SPACE);
    spaces = (WIDTH - strlen(top)) / 2;
    putchar(SIGN);
    show_n_char(SPACE,spaces);
    printf("%s", top);
    show_n_char(SPACE,spaces);
    putchar(SIGN);
    putchar('\n');
    every_line(choice1,choice2);
    every_line(choice3,choice4);
    every_line(choice5,choice6);
    top_line(SPACE);
    top_line(SIGN);
}
void top_line(char ch)
{
    printf("%c",SIGN);//putchar(SIGN);
    show_n_char(ch,WIDTH);
    putchar(SIGN);
    putchar('\n');
}
void every_line(char * left, char * right)
{
    int middle,spaces;
    middle = MIDDLE - strlen(left) - LEFT;
    spaces = WIDTH - strlen(left) - strlen(right)- LEFT - middle;
    putchar(SIGN);
    show_n_char(SPACE,LEFT);
    printf("%s",left);
    show_n_char(SPACE,middle);
    printf("%s",right);
    show_n_char(SPACE,spaces);
    putchar(SIGN);
    putchar('\n');
}
void show_n_char(char ch,int num)//输出num个ch字符
{
    int count;
    for(count = 1; count <= num; count++){
        putchar(ch);
    }
}
int Max(int a,int b)
{
    int c;
    c = a + b;
    if(a < b){a = b;}
    return a;
}
void Add(void)//同理注释函数Minus,Multiply,Divide
{
    int x,y,z;
    int answer = 0;
    printf("Input number 888 to return Menu!!!\n");
    printf("\n");
    srand((unsigned)time(NULL));
    x = rand()%100 + 1;
    y = rand()%100 + 1;
    z = x + y;//随机生成下,一百以内的自然数xy,并计算他们的和z
    printf("%d + %d = ",x,y);
    scanf("%d",&answer);
    while(answer != 888){
            if(z == answer){
                x = rand()%100 + 1;
                y = rand()%100 + 1;
                z = x + y;
                printf("%d + %d = ",x,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d + %d = ",x,y);
            }
            scanf("%d",&answer);
    };//利用while循环满足多次不相同的计算练习
    printf("\n");
    main();
}
void Minus(void)
{
    int x,y,z;
    int answer = 0;
    printf("Input number 888 to return Menu!!!\n");
    printf("\n");
    srand((unsigned)time(NULL));
    x = rand()%100 + 1;
    y = rand()%100 + 1;
    z = x + y;
    x = Max(x,y);
    y = z - x;
    z = x - y;
    printf("%d - %d = ",x,y);
    scanf("%d",&answer);
    while(answer != 888){
            if(z == answer){
                x = rand()%100 + 1;
                y = rand()%100 + 1;
                z = x - y;
                printf("%d - %d = ",x,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d - %d = ",x,y);
            }
            scanf("%d",&answer);
    };
    printf("\n");
    main();
}
void Multiply(void)
{
    int x,y,z;
    int answer = 0;
    printf("Input number 888 to return Menu!!!\n");
    printf("\n");
    srand((unsigned)time(NULL));
    x = rand()%10 + 1;
    y = rand()%10 + 1;
    z = x * y;
    printf("%d * %d = ",x,y);
    scanf("%d",&answer);
    while(answer != 888){
            if(z == answer){
                x = rand()%10 + 1;
                y = rand()%10 + 1;
                z = x * y;
                printf("%d * %d = ",x,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d * %d = ",x,y);
            }
            scanf("%d",&answer);
    };
    printf("\n");
    main();
}
void Divide(void)
{
    int x,y,z;
    int answer = 0;
    printf("Input number 888 to return Menu!!!\n");
    printf("\n");
    srand((unsigned)time(NULL));
    x = rand()%10 + 1;
    y = rand()%10 + 1;
    z = x * y;
    x = z;
    z = x / y;
    printf("%d / %d = ",x,y);
    scanf("%d",&answer);
    while(answer != 888){
            if(z == answer){
                x = rand()%10 + 1;
                y = rand()%10 + 1;
                z = x * y;
                x = z;
                z = x / y;
                printf("%d / %d = ",x,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d / %d = ",x,y);
            }
            scanf("%d",&answer);
    };
    printf("\n");
    main();
}
void Mixed(void)
{
    int x,y,z;
    int i;
    char c;
    int answer = 0;
    printf("Input number 888 to return Menu!!!\n");
    printf("\n");
    srand((unsigned)time(NULL));
    i = rand()%4 + 1;
    switch(i)
    {
        case 1: c = '+'; break;
        case 2: c = '-'; break;
        case 3: c = '*'; break;
        case 4: c = '/'; break;
    }//随机产生四则运算的符号
    switch (c)
    {
        case '+': x = rand()%100 + 1; y = rand()%100 + 1; z = x + y; break;
        case '-': x = rand()%100 + 1; y = rand()%100 + 1; z = x + y; x = Max(x,y); y = z - x; z = x - y; break;
        case '*': x = rand()%10 + 1; y = rand()%10 + 1; z = x * y; break;
        case '/': x = rand()%10 + 1; y = rand()%10 + 1; z = x * y; x = z; z = x / y; break;
    }
    printf("%d %c %d = ",x,c,y);
    scanf("%d",&answer);
    while(answer != 888){
            if(z == answer){
                i = rand()%4 + 1;
                switch(i)
                {
                    case 1: c = '+'; break;
                    case 2: c = '-'; break;
                    case 3: c = '*'; break;
                    case 4: c = '/'; break;
                }
                switch (c)
                {
                    case '+': x = rand()%100 + 1; y = rand()%100 + 1; z = x + y; break;
                    case '-': x = rand()%100 + 1; y = rand()%100 + 1; z = x + y; x = Max(x,y); y = z - x; z = x - y; break;
                    case '*': x = rand()%10 + 1; y = rand()%10 + 1; z = x * y; break;
                    case '/': x = rand()%10 + 1; y = rand()%10 + 1; z = x * y; x = z; z = x / y; break;
                }
                printf("%d %c %d = ",x,c,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d %c %d = ",x,c,y);
            }
            scanf("%d",&answer);
    };//同样利用while循环满足多次不相同的计算练习
    printf("\n");
    main();
}
 

#define SIGN '*'
没啥问题啊,引号不是全角吧

看起来好像没什么问题
考虑把源码粘贴上来我拿过来跑一下试试?


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define WIDTH 40
#define MIDDLE 25
#define LEFT 5
#define SPACE ' '
#define SIGN '*'

void Menu(void);
void top_line(char ch);
void every_line(char * left, char * right);
void show_n_char(char ch,int num);
int Max(int a,int b);
void Add(void);
void Minus(void);
void Multiply(void);
void Divide(void);
void Mixed(void);

void main(void)
{
    int choice;

    Menu();
    printf("Please choose one number : ");
    scanf("%d",&choice);
    printf("\n");

    switch(choice)
    {
        case 1: Add();break;
        case 2: Minus();break;
        case 3: Multiply();break;
        case 4: Divide();break;
        case 5: Mixed();break;
        case 6: return 0;
        default: {printf("\n"),printf("Wrong! Please choose another true number!!\n"),printf("\n"),main();};
    }

    return 0;
}

void Menu(void)
{
    int spaces;
    int middle;

    const char * top = "THE MENU";
    const char * choice1 = "1.add(+)";
    const char * choice2 = "2.minus(-)";
    const char * choice3 = "3.multiply(*)";
    const char * choice4 = "4.divide(/)";
    const char * choice5 = "5.mixed ";
    const char * choice6 = "6.Exit";

    void top_line(SIGN);

    void top_line(SPACE);

    spaces = (WIDTH - strlen(top)) / 2;
    putchar(SIGN);
    show_n_char(SPACE,spaces);
    printf("%s", top);
    show_n_char(SPACE,spaces);
    putchar(SIGN);
    putchar('\n');

    every_line(choice1,choice2);
    every_line(choice3,choice4);
    every_line(choice5,choice6);

    void top_line(SPACE);

    void top_line(SIGN);
}

void top_line(char ch)
{
    printf("%c",SIGN);//putchar(SIGN);
    show_n_char(ch,WIDTH);
    putchar(SIGN);
    putchar('\n');
}

void every_line(char * left, char * right)
{
    int middle,spaces;

    middle = MIDDLE - strlen(left) - LEFT;
    spaces = WIDTH - strlen(left) - strlen(right)- LEFT - middle;
    putchar(SIGN);
    show_n_char(SPACE,LEFT);
    printf("%s",left);
    show_n_char(SPACE,middle);
    printf("%s",right);
    show_n_char(SPACE,spaces);
    putchar(SIGN);
    putchar('\n');
}

void show_n_char(char ch,int num)//输出num个ch字符
{
    int count;

    for(count = 1; count <= num; count++){
        putchar(ch);
    }
}

int Max(int a,int b)
{
    int c;
    c = a + b;
    if(a < b){a = b;}
    return a;
}

void Add(void)//同理注释函数Minus,Multiply,Divide
{
    int x,y,z;
    int answer = 0;

    printf("Input number 888 to return Menu!!!\n");
    printf("\n");

    srand((unsigned)time(NULL));
    x = rand()%100 + 1;
    y = rand()%100 + 1;
    z = x + y;//随机生成下,一百以内的自然数xy,并计算他们的和z

    printf("%d + %d = ",x,y);
    scanf("%d",&answer);

    while(answer != 888){
            if(z == answer){
                x = rand()%100 + 1;
                y = rand()%100 + 1;
                z = x + y;
                printf("%d + %d = ",x,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d + %d = ",x,y);
            }
            scanf("%d",&answer);
    };//利用while循环满足多次不相同的计算练习

    printf("\n");
    main();
}

void Minus(void)
{
    int x,y,z;
    int answer = 0;

    printf("Input number 888 to return Menu!!!\n");
    printf("\n");

    srand((unsigned)time(NULL));
    x = rand()%100 + 1;
    y = rand()%100 + 1;
    z = x + y;
    x = Max(x,y);
    y = z - x;
    z = x - y;

    printf("%d - %d = ",x,y);
    scanf("%d",&answer);

    while(answer != 888){
            if(z == answer){
                x = rand()%100 + 1;
                y = rand()%100 + 1;
                z = x - y;
                printf("%d - %d = ",x,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d - %d = ",x,y);
            }
            scanf("%d",&answer);
    };

    printf("\n");
    main();
}

void Multiply(void)
{
    int x,y,z;
    int answer = 0;

    printf("Input number 888 to return Menu!!!\n");
    printf("\n");

    srand((unsigned)time(NULL));
    x = rand()%10 + 1;
    y = rand()%10 + 1;
    z = x * y;

    printf("%d * %d = ",x,y);
    scanf("%d",&answer);

    while(answer != 888){
            if(z == answer){
                x = rand()%10 + 1;
                y = rand()%10 + 1;
                z = x * y;
                printf("%d * %d = ",x,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d * %d = ",x,y);
            }
            scanf("%d",&answer);
    };

    printf("\n");
    main();
}

void Divide(void)
{
    int x,y,z;
    int answer = 0;

    printf("Input number 888 to return Menu!!!\n");
    printf("\n");

    srand((unsigned)time(NULL));
    x = rand()%10 + 1;
    y = rand()%10 + 1;
    z = x * y;
    x = z;
    z = x / y;

    printf("%d / %d = ",x,y);
    scanf("%d",&answer);

    while(answer != 888){
            if(z == answer){
                x = rand()%10 + 1;
                y = rand()%10 + 1;
                z = x * y;
                x = z;
                z = x / y;
                printf("%d / %d = ",x,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d / %d = ",x,y);
            }
            scanf("%d",&answer);
    };

    printf("\n");
    main();
}

void Mixed(void)
{
    int x,y,z;
    int i;
    char c;
    int answer = 0;

    printf("Input number 888 to return Menu!!!\n");
    printf("\n");

    srand((unsigned)time(NULL));
    i = rand()%4 + 1;
    switch(i)
    {
        case 1: c = '+'; break;
        case 2: c = '-'; break;
        case 3: c = '*'; break;
        case 4: c = '/'; break;
    }//随机产生四则运算的符号

    switch (c)
    {
        case '+': x = rand()%100 + 1; y = rand()%100 + 1; z = x + y; break;
        case '-': x = rand()%100 + 1; y = rand()%100 + 1; z = x + y; x = Max(x,y); y = z - x; z = x - y; break;
        case '*': x = rand()%10 + 1; y = rand()%10 + 1; z = x * y; break;
        case '/': x = rand()%10 + 1; y = rand()%10 + 1; z = x * y; x = z; z = x / y; break;
    }

    printf("%d %c %d = ",x,c,y);
    scanf("%d",&answer);

    while(answer != 888){
            if(z == answer){
                i = rand()%4 + 1;
                switch(i)
                {
                    case 1: c = '+'; break;
                    case 2: c = '-'; break;
                    case 3: c = '*'; break;
                    case 4: c = '/'; break;
                }
                switch (c)
                {
                    case '+': x = rand()%100 + 1; y = rand()%100 + 1; z = x + y; break;
                    case '-': x = rand()%100 + 1; y = rand()%100 + 1; z = x + y; x = Max(x,y); y = z - x; z = x - y; break;
                    case '*': x = rand()%10 + 1; y = rand()%10 + 1; z = x * y; break;
                    case '/': x = rand()%10 + 1; y = rand()%10 + 1; z = x * y; x = z; z = x / y; break;
                }
                printf("%d %c %d = ",x,c,y);
            }
            else{
                printf("\n");
                printf("Wrong!!! Please try again!\n");
                printf("%d %c %d = ",x,c,y);
            }
            scanf("%d",&answer);
    };//同样利用while循环满足多次不相同的计算练习

    printf("\n");
    main();
}