Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- float a, b, x, y;
- cin >> a >> b;
- if (a < 0) a = a * (-1.0);
- if (b < 0) b = b * (-1.0);
- x = (a + b) / 2;
- y = sqrt(a * b);
- x = round(x * 1000.0) / 1000.0;
- y = round(y * 1000.0) / 1000.0;
- cout << x << " " << y;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement