#include <stdio.h> float Max = 0, Min = 0; int main() { float average(float
array[], int n); float ave, score[10]; int i; for(i = 0; i < 10; i++)
scanf("%f",&score[i]); ave = average(score, 10); printf("max = %6.2f\nmin =
%6.2f\naverage = %6.2f\n", Max, Min, ave); return 0; } float average(float
array[], int n) { int i; float aver, sum = array[0]; Max = Min = array[0];
for(i = 1; i < n; i++) { if(array[i] > Max) Max = array[i]; else if(array[i] <
Min) Min = array[i]; sum = sum + array[i]; } aver = sum/n; return aver; }

技术
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:766591547
关注微信