Odpowiedź:
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
float a,b,c;
float delta,p,q;
bool run=true;
int main()
{
while (run) {
cin >> a >> b >> c;
delta = pow(b,2) - 4*(a*c);
p = -b/(2*a);
q = -delta/(4*a);
if (a==0 or b==0) {
run=false;
cout << "ERROR, wspolczynnik rowny 0" << endl;
}
else {
cout << "p: " << p << endl;
cout << "q: " << q << endl;
};
};
return 0;
}
-------------------------------------
Input: 1 2 3
Output: p = -1
q = 2