#include <iostream>
using namespace std;
int main()
{
int i=0,m=0,n=100,x=0,y=0,a[10],z;
double sum=0;
cout<<"请输入小组人数:";
cin>>z;
while(i<=z-1)
{
cout<<"请输入第"<<i+1<<"位同学的成绩:";
cin>>a[i];
i++;
}
for(i=0; i<=z-1; i++)
{
sum=sum+a[i];
}
sum=sum/z;
cout<<"平均成绩为:"<<sum<<endl;
for(i=0; i<=z-1; i++)
{
if(a[i]>m)
{
m=a[i];
}
}
cout<<"最高成绩为:"<<m<<" ";
cout<<"学号为:";
for(i=0; i<=z-1; i++)
{
if(a[i]==m)
{
x++;
cout<<i+1<<" ";
}
}
cout<<"最高绩人数为"<<x<<endl;
for(i=0; i<=z-1; i++)
{
if(a[i]<n)
{
n=a[i];
}
}
cout<<"最低成绩为:"<<n<<" ";
cout<<"学号为:";
for(i=0; i<=z-1; i++)
{
if(a[i]==n)
{
y++;
cout<<i+1<<" ";
}
}
cout<<"最低绩人数为"<<y<<endl;
return 0;
}
<img src="https://img-blog.csdn.net/20141123215618278?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHVhbmd5b25nMDAw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />