记录下来,因为我容易忘

#include<stdio.h>
#include<math.h>
int main()
{
	double a, b, c;
	scanf("%lg%lg%lg", &a, &b, &c);
	printf("原方程为:%g*x*x + %g*x + %g = 0\n", a, b, c);
	if (a == 0)
	{
		if (b == 0)
		{
			if (c == 0)
			{
				printf("\nx可以为任意值");
			}
			else
			{
				printf("\nx无解");
			}
		}
		else
		{
			printf("该方程不是二次方程\nx = %.2f\n", -1.0 * c / b);//一元一次方程
		}
	}
	else
	{
		int N = b * b - 4 * a * c;
		double X = -1.0 * b / 2 / a;
		if (N == 0)
		{
			printf("该方程有2个相等实根\nx1 = %.2f, x2 = %.2f\n", X, X);
		}
		else if (N > 0)
		{
			double Y = sqrt(N) / 2.0 / a;
			printf("该方程有2个不等实根\nx1 = %.2f, x2 = %.2f\n", X + Y, X - Y);
		}
		else
		{
			double Y = sqrt(-1.0 * N) / 2 / a;
			printf("该方程有2个共轭复根\nx1 = %.2f+%.2fi, x2 = %.2f-%.2fi\n", X, Y, X, Y);
		}
	}
	return 0;
}


========================================Talk is cheap, show me the code=======================================