鹰戢展翅
2016-05-12 17:12
#include <stdio.h> /* Jone算出结果应该怎么写函数? */ int joneResult(int x, int y, int z) { int sum = (x+y+z); return sum/3; } void jackResult(int x, int y, int z) { printf("我算不出来\n"); } int main() { int a, b, c; a = 10; b = 20; c = 30; int jR = joneResult(a, b, c); int HY = jackResult(a, b, c); printf("Jone运算结果是:%d\n", jR); printf("Jack运算结果是:",HY); return 0; }
#include "stdio.h"
/* Jone算出结果应该怎么写函数? */
int joneResult(int x, int y, int z)
{
int sum = (x+y+z);
return sum/3;
}
void jackResult(int a,int b,int c)
{
printf("我算不出来\n");
}
int main()
{
int a, b, c;
a = 10;
b = 20;
c = 30;
int jR = joneResult(a, b, c);
/* int HY = jackResult(a, b, c);*/
printf("Jone运算结果是:%d\n", jR);
printf("Jack运算结果是:");
jackResult(a,b,c);
scanf("%d");
return 0;
}
#include <stdio.h>
int joneResult(int x, int y, int z)
{
int sum = (x+y+z);
return sum/3;
}
int jackResult(int x, int y, int z)
{
printf("我算不出来\n");
}
int main()
{
int a, b, c;
a = 10;
b = 20;
c = 30;
int jR = joneResult(a,b,c);
printf("Jone运算结果是:%d\n", jR);
printf("Jack运算结果是:");
jackResult(a,b,c);//按照他提示说的不需要将函数作为结果,直接使用函数即可输出结果
return 0;
}
C语言入门
926020 学习 · 20793 问题
相似问题