Mam problem, gdyż kod od momentu wypisania zmiennej D, nie chce wykonywać kolejnych poleceń.
#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
using namespace std;
int main() {
int a,b,c;
int D;
int x1,x2;
cout << "Podaj wspolczynnik kierunkowy a: ";
cin >> a;
while(a==0){
cout << "Podaj wspolczynnik kierunkowy a: ";
cin >> a;
}
if(a!=0){
cout << "Podaj wspolczynnik b i c \n";
cin >> b;
cin >> c;
D = b*b-4*a*c;
cout << D;
if(D==0){
x1 = (-b)/2*a;
cin >> x1;
if(D<0){
cout << "Brak pierwiastkow";
if(D>0){
x1 = ((-b)-sqrt(D))/2*a;
x1 = ((-b)+sqrt(D))/2*a;
cin >> x1;
cin >> x2;
}
}
}
}
printf("\n");
system("pause");
}