#include <stdio.h>
int average(int a,int b,int c);
void main(void)
{
int a=4,b=5,c=3;
int z= average(a,b,c);
printf("The average of them is %d",z);
}
/*函数名是average
参数表是a,b,c 3个整形参数
返回值是整型,返回3个整数的平均值
*/
int average(int a,int b,int c)
{
return (a+b+c)/3;
}
楼主是这个意思吗?如果用scanf就自己改改吧!