Advertisement
rikardoricz

8 IF Tomasz Świątek 3BTI/2

Nov 17th, 2020
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     float a,b,c;
  8.  
  9.     cout << "Podaj pierwsza liczbe: " << endl;
  10.     cin >> a;
  11.     cout << "Podaj druga liczbe: " << endl;
  12.     cin >> b;
  13.     cout << "Podaj trzecia liczbe: " << endl;
  14.     cin >> c;
  15.     if (a<b&&a<c) //najmniejsza a
  16.     {
  17.         if (b<c)
  18.         {
  19.             cout <<a<<" "<<b<<" "<<c;
  20.         }
  21.         else
  22.         {
  23.             cout <<a<<" "<<c<<" "<<b;
  24.         }
  25.     }
  26.     else if (b<a&&b<c) //najmniejsza b
  27.     {
  28.         if (a<c)
  29.         {
  30.             cout <<b<<" "<<a<<" "<<c;
  31.         }
  32.         else
  33.         {
  34.             cout <<b<<" "<<c<<" "<<a;
  35.         }
  36.     }
  37.     else if (c<b&&c<a) //najmniejsza c
  38.     {
  39.         if (a<b)
  40.         {
  41.             cout <<c<<" "<<a<<" "<<b;
  42.         }
  43.         else
  44.         {
  45.             cout <<c<<" "<<b<<" "<<a;
  46.         }
  47.     }
  48.     return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement