C++程序:
#include
#define MAX 100
using namespace std;
void main()
{
double arr[MAX];
int n = 10;
int i;
double sum = 0;
double avg;
double max;
printf("请输入 %d 个数:", n);
for(i=0; i
>arr[i];
}
sum = arr[0];
max = arr[0];
for(i=1; i
max)
{
max = arr[i];
}
}
avg = sum / n;
cout<<"最大值:"<
评论
0
0
加载更多