3 solutions
-
0
Guest MOD
- 1
Information
- ID
- 1343
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 4
- Tags
- (None)
- # Submissions
- 113
- Accepted
- 54
- Uploaded By
#include<bits/stdc++.h> using namespace std; int a[3]; int main(){ cin>>a[0]>>a[1]>>a[2]; for(int i=0;i<3;i++){ for(int j=i+1;j<3;j++){ if(a[i]>a[j]){ swap(a[i],a[j]); } } } cout<<a[0]<<" "<<a[1]<<" "<<a[2]; return 0; } 拿去抄,Don't 谢谢我
```cpp
#include<iostream>
using namespace std;
int a[3];
int main(){
cin>>a[0]>>a[1]>>a[2];
for(int i=0;i<3;i++){
for(int j=i+1;j<3;j++){
if(a[i]>a[j]){
swap(a[i],a[j]);
}
}
}
cout<<a[0]<<" "<<a[1]<<" "<<a[2];
return 0;
}
#include<bits/stdc++.h> using namespace std; int main(){ int a, b, c, max; cin >> a >> b >> c; if(a < b){ max = a; a = b; b = max; } if(a < c){ max = a; a = c; c = max; } if(b < c){ max = b; b = c; c = max; } cout << a << " " << b << " " << c << endl; return 0; }
By signing up a Hydro universal account, you can submit code and join discussions in all online judging services provided by us.