Advertisement
JakubJaneczek

Zadanie 13

Apr 7th, 2020
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int a, b, c;
  5. int max(int a, int b, int c){
  6.     if(a>b && a>c){
  7.         return a;
  8.     }
  9.     else if (b>a && b>c){
  10.         return b;
  11.     }
  12.     else if (c>a && c>b){
  13.         return c;
  14.     }
  15. }
  16. int main()
  17. {
  18.     cout << max(5,6,7) << endl;
  19.     cout << max(10,12,14) << endl;
  20.     cout << "Podaj trzy liczby" << endl;
  21.     cin >> a;
  22.     cin >> b;
  23.     cin >> c;
  24.     cout << endl << "Najwieksza liczba to: " << max(a,b,c) << endl;
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement