Advertisement
Caneq

lb1.3.8

Oct 29th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. // lb1.3.8.cpp: определяет точку входа для консольного приложения.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11.     double x1, x2, x3, x4, tmp;
  12.     cout << "x1 x2 x3 x4:" << endl;
  13.     cin >> x1 >> x2 >> x3 >> x4;
  14.     if (x4 > x3) {
  15.         tmp = x3;
  16.         x3 = x4;
  17.         x4 = tmp;
  18.     }
  19.     if (x3 > x2) {
  20.         tmp = x3;
  21.         x3 = x2;
  22.         x2 = tmp;
  23.         if (x4 > x3) {
  24.             tmp = x3;
  25.             x3 = x4;
  26.             x4 = tmp;
  27.         }
  28.     }
  29.     if (x1 > x2) {
  30.         tmp = x1;
  31.         x1 = x2;
  32.         x2 = tmp;
  33.     }
  34.     cout << x1 << " < " << x2 << " > " << x3 << " > " << x4 << endl;
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement