Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL,"russian");
- float a,b,c,D;
- cout << "Введите три числа: ";
- cin >> a >> b >> c;
- D=b*b-(4*a*c);
- if (D>=0) {
- cout << "X1=" << (-b+sqrt(D))/(2*a) << endl;
- cout << "X2=" << (-b-sqrt(D))/(2*a) << endl;
- }
- else {
- cout << "Нет корней";
- }
- }
Add Comment
Please, Sign In to add comment