#include<stdio.h>
#include<math.h>
int main()
{
	int a,b,c,x1,x2,d;
	printf(" 请输入方程组的三个系数:");
	scanf("%d,%d,%d", &a, &b, &c);
	if (a!= 0)
	{
		d = sqrt(b * b - 4*a * c);
			x1 = (-b + d) / (2*a);
			x2 = (-b - d) / (2*a);
		printf("该方程两个根分别为:x1=%d,x2=%d",x1,x2);
	}
			
		else
			printf("该方程不是一元二次方程组!");

	
	return 0;
}

版权声明:本文为m0_46487116原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/m0_46487116/article/details/129589013