#include<stdio.h>
int FindMax(int score[],int n);
int ReadScore(int score[]);
int main()
{
int i,c;
int score[i],n;
n=ReadScore(score);
printf("Total students are : %d\n",n);
c=FindMax(score,n);
printf("MAX=%d",c);
return 0;
}
int ReadScore(int score[])
{
int i=-1;
do
{
i++;
printf("please input the scores:\n");
scanf("%d",&score[i]);
}while(score[i]>=0);
return i;
}
int FindMax(int score[],int n)
{
int max,i;
max=score[0];
for(i=1;i<n;i++)
{
if(score[i]>max)
{
max=score[i];
}
}
return max;
}
![](https://profile-avatar.csdnimg.cn/default.jpg!4)
老哥们,请问这个自定义函数里面的数组的值是怎末传递到FindMax这个函数里面的啊
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- CSDN专家-sinJack 2021-06-28 13:04关注
main方法里面有调用哦。c=FindMax(score,n);通过这块传递的。
在你的代码中加粗标记了。
int main()
{
int i,c;
int score[i],n;
n=ReadScore(score);
printf("Total students are : %d\n",n);
c=FindMax(score,n);
printf("MAX=%d",c);
return 0;
}如有帮助,请点击我回答右上角【采纳】按钮。
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 所有双上限都是无限的
- ¥15 LASSO回归分析筛选关键基因,适合多大样本量?
- ¥88 error: [polling_error] {"code":"ETELEGRAM","message":"ETELEGRAM: 502 Bad Gateway"}错误
- ¥15 运行代码哪里需要更改或者增加,求解
- ¥15 基于matab语言描述表示泥浆密度沿着管路的长度方向在不断变化根据上述描述表示泥浆密度沿着管路的长度方向在不断变化,如何来表示泥浆密度随管路流速的变化
- ¥15 刚毕业,刚通过一家PLC工程师,请问一下待遇还算可以吗?
- ¥15 Spring Boot
- ¥15 一个小程序关于简单的增删改查
- ¥15 公司内网,想基本不写代码挂一些视频,有一个还不错的前端展示,有什么软件或者框架可以用吗?尽量简单
- ¥15 appium自动化测试