fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. double abs(double);
  5. double cube(double);
  6. double max(double,double);
  7.  
  8. int main(void) {
  9. double a, b;
  10. a = -3.2;
  11. b = 1.4;
  12. printf("max(|%f|,(%f)^3)=%f\n",a,b,max(abs(a),cube(b)));
  13. return 0;
  14. }
  15.  
  16. double max(double x, double y){
  17. return (x>y)?x:y;
  18. }
  19.  
  20. double abs(double x){
  21. return (x>0)?x:-x;
  22. }
  23.  
  24.  
  25. double cube(double x){
  26. return x*x*x;
  27. }
  28.  
  29.  
  30.  
  31.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
max(|-3.200000|,(1.400000)^3)=3.200000