qq_44884197
2019-05-04 13:17求学生分数中的最高分,并输出分数,学生和课程
#include<stdio.h>
float score[2][5]
int r,c
void main()
{
float highest(float array[2][5]);
int i,j;
for(i=0;i<2;i++)
for(j=0;j<5;j++)
scanf("%f",&score[i][j]);
printf("%f %d %d",highest(score),r,c);
}
float highest(float array[2][5])
{
int i,j;
float max;
max=array[0][0];
for(i=0;i<2;i++)
for(j=0;j<5;j++)
if(array[i][j]>max)
{
max=array[i][j];
r=i+1;
c=j+1;
}
return max;
}
--------------------Configuration: 1 - Win32 Debug--------------------
Compiling...
1.c
C:\Users\HP\Desktop\函数复杂\1.c(3) : error C2054: expected '(' to follow 'score'
C:\Users\HP\Desktop\函数复杂\1.c(3) : error C2085: 'r' : not in formal parameter list
C:\Users\HP\Desktop\函数复杂\1.c(4) : error C2085: 'c' : not in formal parameter list
C:\Users\HP\Desktop\函数复杂\1.c(4) : error C2143: syntax error : missing ';' before 'type'
C:\Users\HP\Desktop\函数复杂\1.c(5) : error C2085: 'main' : not in formal parameter list
C:\Users\HP\Desktop\函数复杂\1.c(5) : error C2143: syntax error : missing ';' before '{'
C:\Users\HP\Desktop\函数复杂\1.c(24) : error C2065: 'r' : undeclared identifier
C:\Users\HP\Desktop\函数复杂\1.c(25) : error C2065: 'c' : undeclared identifier
执行 cl.exe 时出错.
1.obj - 1 error(s), 0 warning(s)
求助大佬这个程序该怎么改???要运用函数
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- 学生分数中的最高分的相关问题
- c语言
- 1个回答
- 求学生分数中的最高分,并输出分数,学生和课程
- c语言
- 1个回答
- 请问,怎么实现求输入的平均成绩 ?
- 实例
- 测试
- 数据
- 1个回答
- 我这代码的computer的最高分和最低分老不对,怎么办?
- c
- 软件开发
- 算法
- 编程
- 管理系统
- 3个回答
- 我这个给各位学生的总分排名的代码错哪了?
- c
- 算法
- 编程
- 排名
- 管理系统
- 7个回答