#include<iostream>
using namespace std;
void swap(int &x,int &y){ int z=x; x=y; y=z; }
int main(){
int a,b,c,d,e;
while(cin>>a>>b>>c>>d>>e){
if(a>b) swap(a,b);
if(c>d) swap(c,d);
if(b>d){ b=d; swap(a,c); }
if(c>e) swap(c,e);
if(b>e){
if(a>e) cout<<a<<endl;
else cout<<e<<endl;
}
else{
if(b>c) cout<<b<<endl;
else cout<<c<<endl;
}
}
return 0;
}
五个数如何只通过六次比较找出中位数
最新推荐文章于 2021-10-22 12:54:40 发布