#include <iostream>
#include <cmath>
using namespace std;
int main()
{
do {
float a, b, c, D, x1, x2;
char g;
cout << "Введите a, b, c. \n"
<< "a="; cin >> a;
cout << "b="; cin >> b;
cout << "c="; cin >> c;
if( (D=b*b-4*a*c)>=0 ){
x1=(-b+sqrt(D))/(2*a);
x2=(-b-sqrt(D))/(2*a);
cout << "D=b*b-4*a*c="<< D << endl
<< "x1=(-b+sqrt(D))/(2*a)=" << x1 << endl
<< "x2=(-b-sqrt(D))/(2*a)=" << x2 << endl;
}
else {cout << "Решений нет." << endl;}
cout << "Вы хотите продолжить(Y/N)?" << endl;
cin >> g;
}
while(g !='n');
return 0;
}
serg.cpp: In function ‘int main()’:
serg.cpp:27:8: error: ‘g’ was not declared in this scope
while(g !='n');
^