Advertisement
MichalWalczak

Zad 13

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