问答详情
源自:5-5 函数的返回值

求大神帮忙,那错了??

#include <stdio.h>
int joneResult(int x, int y, int z)
{
   int sum = (x+y+z)/3;
   return 0;
}


 void jackResult(int x, int y, int z)
{
    printf("我算不出来\n");
}
int main()
{
    int a, b, c,jr;
    a = 10;
    b = 20;
    c = 30;
    jr = joneResult(a, b, c);
    printf("Jone运算结果是:%d\n",jr );
    printf("Jack运算结果是:");
    jackResult(a,b,c);
    return 0;
}


提问者:pengzeming 2015-11-26 21:13

个回答

  • loser_by
    2015-11-28 09:58:12

    应该是return sum

  • 攻城没有狮
    2015-11-26 22:51:12

    joneResult函数返回值是0,jr的值所以是0