ccf小中大25分 孩子要哭了

https://blog.csdn.net/xyy731121463/article/details/96566999

#include
#include
using namespace std;
int main(){
long long n,k,a[1005],b[1005];
cin>>n;
if(n==0){
cout< return 0;
}
k=0;//无重复数数组长度
for(long long i=1;i cin>>a[i];
b[i]=a[i];
k++;
}
if(k%2==0)
{
if(b[1]<b[k]){
if((b[k/2]+b[k/2+1])%2==0)
cout<<b[k]<<" "<<fixed<<setprecision(1)<<(b[k/2]+b[k/2+1])/2<<" "<<b[1]<<endl;
else
cout<<b[k]<<" "<<fixed<<setprecision(1)<<(double)(b[k/2]+b[k/2+1])/2<<" "<<b[1]<<endl;
}

else{
if((b[k/2]+b[k/2+1])%2==0)
cout<<b[1]<<" "<<fixed<<setprecision(1)<<(b[k/2]+b[k/2+1])/2<<b[k]<<" "<<endl;

else
cout<<b[1]<<" "<<fixed<<setprecision(1)<<(double)(b[k/2]+b[k/2+1])/2<<b[k]<<" "<<endl;

}

}
else
{
if(b[1]<b[k])
    cout<<b[k]<<" "<<b[k/2+1]<<" "<<b[1]<<endl;
else
cout<<b[1]<<" "<<b[k/2+1]<<" "<<b[k]<<endl;
}

return 0;

}

c++
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问