展开全部
#include <<a href="https://www.baidu.com/s?wd=stdio.h&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLm1IBPjf3mWm4mhm4PWK90ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHDknHD4njRkP1TvPWDLPHf4rf" target="_blank" class="baidu-highlight">stdio.h</a>>
int iMax = 0;
int fooMax(int arr[], int n) {
int i;
for (i = 0; i < n; i++)
if (iMax < arr[i]) {
iMax = arr[i];
}
return iMax;
}
int main() {
int arr[5] = {
10, 8, 15, 7, -1
};
printf("Max : %d\n", fooMax(arr, 5));
printf("Max : %d\n", iMax);
return 0;
}
int iMax = 0;
int fooMax(int arr[], int n) {
int i;
for (i = 0; i < n; i++)
if (iMax < arr[i]) {
iMax = arr[i];
}
return iMax;
}
int main() {
int arr[5] = {
10, 8, 15, 7, -1
};
printf("Max : %d\n", fooMax(arr, 5));
printf("Max : %d\n", iMax);
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询