Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include "src\maxim.cpp"
  3. #define Log(x) cout << x << endl;
  4.  
  5. using namespace std;
  6.  
  7. void maximum(int a, int b, int c, int d){
  8. int maxim;
  9. if( a > b && a > c && a > d )
  10. maxim = a;
  11. else if ( b > a && b > c && b > d)
  12. maxim = b;
  13. else if (c > a && c > b && c > d)
  14. maxim = c;
  15. else if (d > a && d > b && d > c)
  16. maxim = d;
  17. cout << maxim;
  18. }
  19.  
  20.  
  21. int main()
  22. {
  23. int a, b, c, d;
  24. Log(" a: ");
  25. cin >> a;
  26. Log(" b: ");
  27. cin >> b;
  28. Log(" c: ");
  29. cin >> c;
  30. Log(" d: ");
  31. cin >> d;
  32. maximum(a, b, c, d);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement