fork download
  1. #include <stdio.h>
  2.  
  3. int max_of_four(int x, int z, int y, int w){
  4. int max1 = x > z ? x : z;
  5. int max2 = y > w ? y : w;
  6. return max1 > max2 ? max1 : max2;
  7. }
  8.  
  9. int main() {
  10. int a, b, c, d;
  11. scanf("%d %d %d %d", &a, &b, &c, &d);
  12. int ans = max_of_four(a, b, c, d);
  13. printf("%d", ans);
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/398525/101
Success #stdin #stdout 0s 9424KB
stdin
1
2
3
4
stdout
4