eolymp
bolt
Try our new interface for solving problems
Problems

The height of triangle

published at 12/6/17, 10:45:42 am

goodbye

published at 4/4/22, 10:26:40 pm

В этой задаче напрашивается тест на эффект потери точности. Тесты его не ловят.

published at 4/27/24, 12:48:53 pm

include <iostream>

include <cmath>

include <iomanip>

using namespace std;

int main() { int a, b; cin >> a; cin >> b;

int c = -(2 * a);

double x1 = (-(b) + (sqrt((b * b) - 4 * c))) / 2.0;
cout << fixed << setprecision(2) << x1 << endl;

return 0;

}