Bootstrap

vs19 c++ 解二元一次方程

#include<iostream>
#include<math.h>
using namespace std;
float a, b, c;
float d,x1, x2;
int main()
{
	scanf_s("%f %f %f", &a, &b, &c);

	d=sqrt( b * b - 4 * a * c);
	x1 = (d - b) / (2 * a);
	x2 = (-d - b) / (2 * a);
	if (x1 > x2)
	{
		printf("%.2f %.2f", x1,x2);
	}
	else
	{
		printf("%.2f %.2f", x2,x1);

	}
	return 0;
		
}


;