#include <iostream>
using namespace std;
int main()
{
int n;
double sum=0;
double avg=0;
cout<<"请输入需要统计的学生个数:";
cin>>n;
double score[n];
cout<<"请输入每个学生的成绩:";
for(int i=1;i<=n;i++)
{
cin>>score[i];
if(score[i]>0)
{
sum=sum+score[i];
avg=sum/i;
}
}
cout<<"学生的平均成绩为:"<<avg<<endl;;
cout<<"低于平均成绩的有:";
for(int i=1;i<=n;i++)
{
if(score[i]<avg&&score[i]>0)
{
cout<<score[i]<<" ";
}
else
{
cout<<0;
break;
}
}
return 0;
}