Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cmath>
- #include<fstream>
- using namespace std;
- int main()
- {
- int R, x, y;
- double k, a;
- ifstream in("INPUT.txt");
- in >> R >> x >> y;
- if (x<-10||x>10||y<0||y>R||R>10||y>10)
- {
- return 0;
- }
- a = (double)(x*R) / ((R - y) + R);
- k = round(a * 100) / 100;
- ofstream out("OUTPUT.txt");
- out << k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement