using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication43
{
class Program
{
static void Main(string[] args)
{
double a, b, c;
Console.WriteLine("请输分别入三角形的三条边");
a = Convert.ToDouble(Console.ReadLine());
b = Convert.ToDouble(Console.ReadLine());
c = Convert.ToDouble(Console.ReadLine());
if (a * a == b * b + c * c || b * b == a * a + c * c || c * c == b * b + a * a)
{
if(a==b||a==c||b==c)
Console.WriteLine("此三角形为等腰直角三角形");
else Console.WriteLine("此三角形为一般直角三角形");
}
else if(a==b&&b==c&&a==c)
Console.WriteLine("此三角形为等边三角形");
else if (a >= b + c || b >= c + a || c >= b + a)
Console.WriteLine("此三角形无法成立");
else if (a == b || a == c || b == c)
Console.WriteLine("此三角形为等腰三角形");
else Console.WriteLine("此三角形为一般三角形");
Console.ReadKey();
}
}
}
判断三角形的类型
最新推荐文章于 2021-03-12 14:13:08 发布