#include <stdio.h>
#include <math.h>
#include <conio.h>
void main()
{
float a,b,c; //koeficienti yravneni9
float D; //diskriminant
float x1,x2; //korni yravneni9
int e;
char i;
while(1)
{
clrscr(); //o4istka okna soobwenii
do
{
printf("\n Vvesti koeficienti a,b,c: "); //vivod sobweni9 dl9 vvoda a,b,c
e=scanf("%f%f%f",&a,&b,&c);
if(e!=3)
puts("\n Vvedeno ne 4islo!Povtorite snovo");
fflush(stdin);
}
while(e!=3);
D=(b*b-4*a*c);
printf(" D= %f ",D);
getch(); //komanda dl9 ostanovki raboti programmi.
if( D>=0 )
{
x1=(-b+sqrt(D))/(2*a);
x2=(-b-sqrt(D))/(2*a);
printf("\n Rezultat vi4eslenii: \n root 1: %f\n root 2: %f",x1,x2);
}
if(D<0)
{
printf("\n Itog: Kornei yravneni9 net:(");
}
puts("\nxotite povtorit? (y/n)");fflush(stdin);
scanf("%c",&i);
if(i=='n') break;
}
}
