Advertisement
Evilerus

minmax

Mar 7th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int max(int a, int b, int c)
  6. {
  7.     if (a>b && a>c)
  8.     {
  9.         return a;
  10.     }
  11.     else if (b>a && b>c)
  12.     {
  13.         return b;
  14.     }
  15.     else if (c>a && c>b)
  16.     {
  17.         return c;
  18.     }
  19.     else
  20.     {
  21.         return a;
  22.     }
  23. }
  24.  
  25. int main(int argc, char **argv)
  26. {
  27.     cout << max(1337,2137,666) << endl;
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement