fork download
  1. #include <stdio.h>
  2.  
  3. float F(float, float);
  4.  
  5. int main(void) {
  6. printf("%f\r\n", F(10, 10));
  7. printf("%f\r\n", F(0.5, 10));
  8. printf("%f\r\n", F(-15, 10));
  9. // your code goes here
  10. return 0;
  11. }
  12.  
  13. float F(float u, float v)
  14. {
  15. return u > 1 ? u + v : u >= 0 ? u - v : v - u;
  16. }
  17.  
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
20.000000
-9.500000
25.000000