输入三条边,判断是否可构成三角形
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(); } } }
相关文章推荐
- 输入三条边并判断是否为三角形,若能构成三角形,指出其为何种三角形:等边、直角亦或者一般三角形
- 控制台输入三条边长,判断是否能构成三角形。如果能构成,输出三角形的周长,并且告知该三角形是什么类型(锐角、直角、钝角),再判断下该三角形是 等腰、等边还是不等边三角形。
- 12月27日任务 从键盘任意输入三角形的三边,判断是否能构成三角形,若能,则计算三角形的面积并输出,若不能,则输出不能构成三角形
- 判断输入的三个数据是否可以构成一个三角形
- java编程:命令行输入的三个整数判断是否构成三角形,不能就抛异常。
- 判断三条边是否构成三角形
- C# 输入三条边,判断是否组成三角形
- 判断输入三条边能否构成三角形
- 从键盘输入三个整数,判断是否能构成三角形
- 输入3个树值,判断以他们为边长是否能构成三角形,如能构成,则判断属于哪种特殊三角形。
- 学会利用java程序编写“随机输入三角形的三边,判断是否能构成三角形“
- 转:从键盘输入三个整数,判断是否能构成三角形
- 输入一串字符,字符个数不超过100,且以“.”结束。 判断它们是否构成回文。
- 输入三边判断是否能组成三角形
- 判断输入三边能否构成三角形
- 算法:从键盘输入能够构成三角形的三条边长,编程计算该三角形的面积
- 输入三角形的三边值,判断能否构成三角形
- 判断三个参数是否能构成一个三角形。如果不能则抛出异常IllegalArgumentException, * 显示异常信息:a,b,c “不能构成三角形”;如果可以构成则显示三角形三个边长。在主方
- 从键盘输入三个正整数,判断它们是否构成等腰三角形
- 设计一个三角形类,能够输入三角形的三个顶点,求出其面积、周长,并判断其是否为直角三角形和等腰三角形