Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int a,b,c,d;
- cin>>a>>b>>c>>d;
- if(a >= b and a >= c and a >= d) {
- if(b >= c and b >= d) {
- if(c >= d) {
- cout << a << " " << b << " " << c << " " << d << endl;
- }
- else {
- cout << a << " " << b << " " << d << " " << c << endl;
- }
- }
- else if(c >= b and c >= d) {
- if(b >= d) {
- cout << a << " " << c << " " << b << " " << d << endl;
- }
- else {
- cout << a << " " << c << " " << d << " " << b << endl;
- }
- }
- else if(d >= b and d >= c) {
- if(b >= c) {
- cout << a << " " << d << " " << b << " " << c << endl;
- }
- else {
- cout << a << " " << d << " " << c << " " << b << endl;
- }
- }
- }
- else if(b >= a and b >= c and b >= d) {
- if(a >= c and a >= d) {
- if(c >= d) {
- cout << b << " " << a << " " << c << " " << d << endl;
- }
- else {
- cout << b << " " << a << " " << d << " " << c << endl;
- }
- }
- else if(c >= a and c >= d) {
- if(a >= d) {
- cout << b << " " << c << " " << a << " " << d << endl;
- }
- else {
- cout << b << " " << c << " " << d << " " << a << endl;
- }
- }
- else if(d >= a and d >= c) {
- if(a >= c) {
- cout << b << " " << d << " " << a << " " << c << endl;
- }
- else {
- cout << b << " " << d << " " << c << " " << a << endl;
- }
- }
- }
- .
- .
- .
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment