您的位置:首页 > 其它

输入三条边,判断是否可构成三角形

2016-10-29 13:33 369 查看
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double a, b, c;
Console.WriteLine("输入三角形的三条变:");
a = double.Parse(Console.ReadLine());
b = double.Parse(Console.ReadLine());
c = double.Parse(Console.ReadLine());
if ((a + b) > c && (a + c) > b && (b + c) > a)
{
double l = a + b + c;
Console.WriteLine("可以构成三角形 三角形的周长是" + l);
}
else {
Console.WriteLine("不能构成三角形");
}
Console.ReadKey();
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐