信息
- ID
- 41
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 6
- 标签
- 递交数
- 178
- 已通过
- 57
- 上传者
#include<iostream>
using namespace std;
int main(){
int a,b,c,d,t;
cin>>a>>b>>c>>d;
if(a>b){
t=a;
a=b;
b=t;
}
if(b>c){
t=b;
b=c;
c=t;
}
//d最大
if(c>d){
t=c;
c=d;
d=t;
}
if(a>b){
t=a;
a=b;
b=t;
}
//abc中c最大
if(b>c){
t=b;
b=c;
c=t;
}
//ab中b最大
if(a>b){
t=a;
a=b;
b=t;
}
//相邻的2个数差值为2,且其中有一个数是奇数
if(a+2==b&&b+2==c&&c+2==d&&a % 2 != 0){
cout<<a<<"+2="<<b<<endl;
cout<<b<<"+2="<<c<<endl;
cout<<c<<"+2="<<d<<endl;
}else{
cout<<d<<" "<<c<<" "<<b<<" "<<a<<endl;
}
}