# -*- coding: utf-8 -*- import math def quadratic(a, b, c): s = b*b - 4*a*c if a == 0: x = -c / b return x elif s==0: x = -b / 2*a return x elif s < 0: return 'no anwser' else: x = (-b + math.sqrt(s)) / (2 * a) y = (-b - math.sqrt(s)) / (2 * a) retur…
一元二次方程的根的情况分为实根与虚根两种,代码如下 #include<iostream> #include<cmath> using namespace std; float *solve_equ(float, float, float);//a, b, c int main() { float a, b, c; cout << "enter a, b, c : " << endl; cin >> a >> b&g…
Console.WriteLine("求解方程ax^2+bx+c=0的解."); Console.WriteLine("请分别输入a,b,c的值(注意每输入一个值按一下回车):"); double a = double.Parse(Console.ReadLine()); double b = double.Parse(Console.ReadLine()); double c = double.Parse(Console.ReadLine()); * a * c;…