计算3个整数的平均数程序出错了,老错在第10步,大侠来 看看....
不知道为什么老是第10步出错...可是我怎么看也不知道错在哪里啊???大侠帮我瞧瞧....错误报告在下面先谢过了
#include <stdio.h>
int average(int a,int b,int c);
void main(void)
{
int a=1,b=2,c=3;
int a2=1234,b2=2345,c2=3456;
int a3=9876,b3=2345,c3=1;
int y = average(a,b,c,);
int y2= average(a2,b2,c2);
int y3= average(a3,b3,c3);
printf("\n the average is %d",y);
printf("\n the average is %d",y2);
printf("\n the average is %d",y3);
}
int average(int a,int b, int c)
{
return (a+b+c)/3;
}
错误报告;
10 illegal expression
10 too marny arguments to “average”
10 syntax error;found;expecting"}"