Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include<cmath>
  3. #include<fstream>
  4.  
  5.  
  6.  
  7. using namespace std;
  8.  
  9.  
  10. int main()
  11. {
  12.  
  13. int R, x, y;
  14.  
  15. double k, a;
  16.  
  17. ifstream in("INPUT.txt");
  18. in >> R >> x >> y;
  19.  
  20. if (x<-10||x>10||y<0||y>R||R>10||y>10)
  21. {
  22. return 0;
  23. }
  24.  
  25. a = (double)(x*R) / ((R - y) + R);
  26.  
  27. k = round(a * 100) / 100;
  28.  
  29. ofstream out("OUTPUT.txt");
  30. out << k;
  31.  
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement