Kacper_Michalak

Seria 2 Zadanie 5

Nov 3rd, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int x;
  8.     int y;
  9.     cout << "Podaj pierwsza liczbe:" << endl;
  10.     cin >> x;
  11.  
  12.     cout << "Podaj druga liczbe: " << endl;
  13.     cin >> y;
  14.  
  15.     if(x < 0)
  16.     {
  17.         x = x * -1;
  18.     }
  19.  
  20.     if (y < 0)
  21.     {
  22.         y = y * -1;
  23.     }
  24.  
  25.     if(x > y)
  26.     {
  27.        cout << "Pierwsza liczba ma wieksza wartosc" << endl;
  28.     }
  29.     else
  30.     {
  31.         cout << "Druga liczba ma wieksza wartosc" << endl;
  32.     }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment