RafalSobala

zad 13

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