感觉没问题呀?为什么还是80%的通过率。。。
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int n;
double sum,temp=0.0;
while(cin>>n)
{
sum=0.0;
vector<double>a;
for(int i =0; i<n;i++)
{
cin>>temp;
sum+=temp;
a.push_back(temp);
}
int ave = sum/n;
for(int i=0;i<n;i++)
{
if(ave>a[i]){
cout<<a[i]<<" ";
}
}
cout<<endl;
}
}
#include<vector>
using namespace std;
int main()
{
int n;
double sum,temp=0.0;
while(cin>>n)
{
sum=0.0;
vector<double>a;
for(int i =0; i<n;i++)
{
cin>>temp;
sum+=temp;
a.push_back(temp);
}
int ave = sum/n;
for(int i=0;i<n;i++)
{
if(ave>a[i]){
cout<<a[i]<<" ";
}
}
cout<<endl;
}
}