Advertisement
NOBLE-_-MAN

3 числа С++

Nov 16th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.   int a, b, c;
  5.   cin >> a >> b >> c;
  6.   if (a>=b and a>=c){
  7.     if (b>c){
  8.         cout << c << " " << b << " " << a;
  9.     }
  10.     else {
  11.         cout << b << " " << c << " " << a;
  12.     }
  13.   }
  14.   else if (b>=a and b>=c){
  15.     if (a>c){
  16.         cout << c << " " << a << " " << b;
  17.     }
  18.     else {
  19.         cout << a << " " << c << " " << b;
  20.     }
  21.   }
  22.   else {
  23.     if (a>b){
  24.         cout << b << " " << a << " " << c;
  25.     }
  26.     else {
  27.         cout << a << " " << b << " " << c;
  28.     }
  29.   }
  30.   return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement