题目描述
blablabla
样例
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main() {
double a, b, c;
cin >> a >> b >> c;
double delta = b * b - 4 * a * c;
if (delta < 0 || a == 0) {
cout << "Impossivel calcular" << endl;
}
else {
double x1 = ((-b) + sqrt(delta)) / 2 / a;
double x2 = ((-b) - sqrt(delta)) / 2 /a;
cout << fixed << setprecision(5) << "R1 = " << x1 << endl;
cout << fixed << setprecision(5) << "R2 = " << x2 << endl;
}
return 0;
}
算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla
算法2
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
blablabla