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 x, y, S, P;
- ifstream in("INPUT.txt");
- in >> S >> P;
- in.close();
- x = (S + sqrt((S * S - 4 * P))) / 2;
- y = S - x;
- ofstream out("OUTPUT.txt");
- if (x<y)
- {
- out << x << " " << y;
- }
- else
- {
- out << y << " " << x;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement