fork download
  1. #include <iostream>
  2.  
  3. int max(int a, int b)
  4. {
  5. return a > b ? a : b ;
  6. }
  7.  
  8. int max(int a, int b, int c)
  9. {
  10. return max(max(a,b),c);
  11. }
  12.  
  13. int main()
  14. {
  15. std::cout << max(1, 2, 3) << '\n' ;
  16. std::cout << max(3, 2, 1) << '\n' ;
  17. std::cout << max(3, 1, 2) << '\n' ;
  18. std::cout << max(1, 3, 2) << '\n' ;
  19. std::cout << max(2, 1, 3) << '\n' ;
  20. std::cout << max(2, 3, 1) << '\n' ;
  21. std::cout << max(-1, 1000, 9) << '\n' ;
  22. std::cout << max(-90, -80, -70) << '\n' ;
  23. }
  24.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
3
3
3
3
3
3
1000
-70