阅读背景:

ax²+bx+c=0(a≠0)

来源:互联网 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication6
{
    class Program
    {
        static void Main(string[] args)
        {
             //软件一班
            //李旭

            double a, b, c;
            Console.WriteLine("请输入a,b,c:");
            a = Convert.ToDouble(Console.ReadLine());
            b = Convert.ToDouble(Console.ReadLine());
            c = Convert.ToDouble(Console.ReadLine());
            if (Math.Pow(b, 2) - 4 * a * c >= 0)
            {
                Console.WriteLine("x1=" + (-b + Math.Sqrt(b * b - 4 * a * c)) / (2 * a));
                Console.WriteLine("x1=" + (-b - Math.Sqrt(b * b - 4 * a * c)) / (2 * a));
            }
            else
            {
                Console.WriteLine("无解!");
                Console.Read();

            }


        }
    }
}using System;
using System.Collections.Generic;



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: