Advertisement
GAMELASTER

Untitled

Apr 20th, 2017
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int cislo1, cislo2, cislo3, zaloznecislo;
  8.     cout << "Napiste cislo 1: ";
  9.     cin >> cislo1;
  10.     cout << "Napiste cislo 2: ";
  11.     cin >> cislo2;
  12.     cout << "Napiste cislo 3: ";
  13.     cin >> cislo3;
  14.     if(cislo1 < cislo2)
  15.     {
  16.         zaloznecislo = cislo1;
  17.         cislo1 = cislo2;
  18.         cislo2 = zaloznecislo;
  19.     }
  20.     if(cislo1 < cislo3)
  21.     {
  22.         zaloznecislo = cislo1;
  23.         cislo1 = cislo3;
  24.         cislo3 = zaloznecislo;
  25.     }
  26.     if(cislo2 < cislo3)
  27.     {
  28.         zaloznecislo = cislo2;
  29.         cislo2 = cislo3;
  30.         cislo3 = zaloznecislo;
  31.     }
  32.     cout << "Porovnanie: " << cislo1 << " > " << cislo2 <<  " > " << cislo3 << endl;
  33.     cout << "Maximalne cislo: " << cislo1 << endl;
  34.     cout << "Minimalne cislo: " << cislo3 << endl;
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement