fork download
  1. #include <stdio.h>
  2.  
  3. //二つの引数の大きい方の値を返す関数
  4. int max(int x, int y){
  5. return (x>y)?x:y;
  6. }
  7.  
  8.  
  9.  
  10. //引数の絶対値を返す関数
  11. int abs(int x){
  12. return (x>0)?x:-x;
  13. }
  14.  
  15. //引数の三乗の値を返す関数
  16. int cube(int x){
  17. return x*x*x;
  18. }
  19.  
  20. //main関数
  21. int main(void) {
  22. int a,b;
  23. scanf("%d %d",&a,&b);
  24.  
  25. printf("max(%d,%d)\n=%d",a,b,max(abs(a),cube(b)));
  26.  
  27.  
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 5320KB
stdin
-9 2
stdout
max(-9,2)
=9