函数应返回函数main中的值 [英] Function should return a value in function main

查看:104
本文介绍了函数应返回函数main中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新用户

并且系统说

函数应该在函数main中返回一个值

我无法解决这个问题

某人请帮助我

Hi I'm new user
And the system say
function should return a value in function main
I can't solved this problem
someone plz help me

#include <stdio.h>
main()
{

    int a,b,c,d,e,f;
    char A,B,C,D,E;

    printf("Insert Name and Birthday(date only) 1 : \n\a");
    scanf("%d",a);
    scanf("%s",A);

    printf("Insert Name and Birthday(date only) 2 : \n");
    scanf("%d",b);
    scanf("%s",B);

    printf("Insert Name and Birthday(date only) 3 : \n");
    scanf("%d",c);
    scanf("%s",C);

    printf("Insert Name and Birthday(date only) 4 : \n");
    scanf("%d",d);
    scanf("%s",D);

    printf("Insert Name and Birthday(date only) 5 : \n");
    scanf("%d",e);
    scanf("%s",E);

    printf("NO.1 Name : %s Birthday : %d\n\a",a,A);
    printf("NO.1 Name : %s Birthday : %d\n",b,B);
    printf("NO.1 Name : %s Birthday : %d\n",c,C);
    printf("NO.1 Name : %s Birthday : %d\n",d,D);
    printf("NO.1 Name : %s Birthday : %d\n",e,E);
    printf("%d+%d-%d*%d/%d",a,b,c,d,e);

}





我的尝试:



我将main()更改为int main(void)但不起作用



What I have tried:

I change the main() to the int main(void) but it not worked

推荐答案

main 需要返回一个整数值:它应该如下所示:

main needs to return an integer value: it should look like this:
#include <stdio.h>
int main()
{
   ...
   return 0;
}

零表示未发现错误 - 任何非零值都是错误代码。

The zero means "no errors found" - any non-zero value is an error code.


这篇关于函数应返回函数main中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆