fork download
  1.  
  2. #include <stdio.h>
  3.  
  4. double max(double x, double y);
  5. double abs(double x);
  6. double cube(double x);
  7.  
  8. int main(void) {
  9. double a, b;
  10. a = 3.0;
  11. b = -2.0;
  12. printf("max(|%.lf|,(%.lf)^3)=%.lf\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. double cube(double x){
  25. return x * x * x;
  26. }
  27.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
max(|3|,(-2)^3)=3