2.3
Larence// ConsoleApplication1.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include "conio.h"
#include "math.h"
int _tmain(int argc, _TCHAR* argv[])
{
float a, b, c, d, x1, x2, x3, x4, t1, t2,x,s;
printf_s(" vvod a,b,c\n");
scanf_s("%f%f%f", &a, &b, &c);
printf(" a=%f, b=%f, c=%f\n", a, b, c);
d = b*b - 4 * a*c;
{if (d > 0)
t1 = (-b + sqrt(d)) / (2 * a);
t2 = (-b - sqrt(d)) / (2 * a);
if (t1 < 0)
x1 = sqrt(t1);
else x1 = sqrt(t1);
x2 = -x1;
if (t2 < 0)
x3 = sqrt(t1);
else x3 = sqrt(t1);
x4 = -x3;
{if (d = 0)
t1 = (-b + sqrt(d)) / (2 * a);
if (t1 < 0)
x1 = sqrt(t1);
else x1 = sqrt(t1);
x2 = -x1;
printf(" x1=%f, x2=%f \n", x1, x2);
return 0;
}
if (d < 0) //Нет конрей
printf(" x1=%f, x2=%f,x3=%f,x4=%f \n", x1, x2, x3, x4);
_getche();
return 0;
}
}