#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include <stdlib.h>
#include<string.h>
#include<math.h>
int solution(float a, float b, float c, float& x1, float& x2)
{
float d = b * b - 4 * a * c;
if (d > 0)
{
x1 = (-b - sqrt(d)) / (2 * a);
x2 = (-b +sqrt(d)) / (2 * a);
return 2;
}
else if (d == 0)
{
x1=x2 = (-b ) / (2 * a);
return 1;
}
else
{
return 0;
}
}
int main()
{
float a = 1, b = 4, c = 4, d = 0, e = 0;
solution(a, b, c, d, e);
printf("d=%.2f e=%.2f\n", d, e);
return 0;
}