fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. float x = 0;
  8. float y = 0;
  9.  
  10. float response;
  11. x = fabs(x);
  12. y = fabs(y);
  13.  
  14. float div = (x > y) ? x:y;
  15. cout << x << " " << y << " " << div << endl;
  16. if (div)
  17. response = (1 - (fabs(x-y) / div)) *100;
  18. else
  19. response = -1.0f;
  20. cout << response << endl;
  21.  
  22.  
  23. return 0;
  24. }
  25.  
  26. float PercentSimilar(float x, float y)
  27. {
  28.  
  29. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
0 0 0
-1