using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
double a,b,c;
string figure;
Console.WriteLine("请输入第一条边长");
a=Convert.ToDouble(Console.ReadLine());
Console.WriteLine("请输入第二条边长");
b = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("请输入第三条边长");
c = Convert.ToDouble(Console.ReadLine());
if (a < b + c && c < a + b && b < a + c)
{
if (a == b && b == c) figure = "等边三角形";
else if (a == b || a == c || b == c) figure = "等腰三角形";
else if (a * a == b * b + c * c || b * b == a * a + c * c || c * c == a * a + b * b) figure = "直角三角形";
else figure = "任意三角形";
}
else figure = "不是三角形";
Console.WriteLine("你所说的三角形式{0}",figure);
Console.Read();
}
}
}
总结:我学会了如何用编程求三角形类型