渴望春天247 2021-06-06 20:33 采纳率: 84.6%
浏览 69
已结题

syntax error : missing ')' before type 'void'?

#include<stdio.h>
#define N 10
#define M 5
float a_stu[N],a_cour[M];
int score[N][M],r,c;
void input(void)
{
	int i,j;
	for(i=0;i<N;i++)
	{
		printf("\ninput score of student%2d:\n",i+1);
		for(j=0;j<M;j++)
			scanf("%d",&score[i][j]);
	}
}
void aver_stu(void)
{
	int i,j;
	float s;
	for(i=0;i<N;i++)
	{
		for(j=0;j<M;j++)
			s+=score[i][j];
		a_stu[i]=s/M;
	}
}
void aver_cour(void)
{
	int i,j;
	float s;
	for(i=0;i<M;i++)
	{
		s=0;
		for(j=0;j<N;j++)
			s+=score[i][j];
		a_cour[j]=s/N;
	}
}
int highest(void)
{
	int high;
	int i,j;
	high=score[0][0];
	for(i=0;i<N;i++)
		for(j=0;j<M;j++)
			if(score[i][j]>high)
			{high=score[i][j];
			r=i+1;
			c=j+1;
			}
	return(high);
}
void main()
{
	int i,j,h;
	input(void);
	aver_stu(void);
	aver_cour(void);
	printf("\n NO.  cour1	cour2	cour3	cour4	cour5 aver\n");
	for(i=0;i<N;i++)
	{
		printf("\n%2d",i+1);
		for(j=0;j<M;j++)
			printf("%5d",score[i][j]);
		printf("%8.2f",a_stu[j]);
	}
		printf("\naverage:");
		for(j=0;j<N;j++)
			printf("%8.2f",a_cour[j]);
		printf("\n");
		h=highest(void);
		printf("hightest:%5d    NO.%2d	course %2d\n",h,r,c);
}
  • 写回答

1条回答 默认 最新

  • SoftwareTeacher 《编程之美》作者 2021-06-06 21:14
    关注

    第几行报的错误? 请往上查找, 一定有语法错误的地方。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 9月27日
  • 已采纳回答 9月19日

悬赏问题

  • ¥15 socket通信实现多人聊天室疑惑
  • ¥15 DEV-C++编译缺失
  • ¥33 找熟练码农写段Pyhthon程序
  • ¥100 怎么让数据库字段自动更新
  • ¥15 antv g6 力导向图布局
  • ¥15 quartz框架,No record found for selection of Trigger with key
  • ¥15 锅炉建模+优化算法,遗传算法优化锅炉燃烧模型,ls-svm会搞,后面的智能算法不会
  • ¥20 MATLAB多目标优化问题求解
  • ¥15 windows2003服务器按你VPN教程设置后,本地win10如何连接?
  • ¥15 求一阶微分方程的幂级数