编程介的小学生 2019-12-31 01:12 采纳率: 20.5%
浏览 153

Triangle 三角形的算法

Problem Description
A triangle is one of the basic shapes of geometry: a polygon with three corners or vertices and three sides or edges which are line segments.
Triangles can be classified according to the relative lengths of their sides:
· In an equilateral triangle all sides have the same length. An equilateral triangle is also a regular polygon with all angles measuring 60°.
· In an isosceles triangle, two sides are equal in length. An isosceles triangle also has two angles of the same measure; namely, the angles opposite to the two sides of the same length; this fact is the content of the Isosceles triangle theorem.
· In a scalene triangle, all sides are unequal. The three angles are also all different in measure. Some (but not all) scalene triangles are also right triangles.

Input
The first line of input contains an integer (1 <= T <= 100), the number of test cases. T test data sets follow, each data set consists of 3 integers A, B and C, where (1 <= A,B,C <= 1,000,000) the triangle side lengths.

Output
For each test case, print “equilateral”, “isosceles” or “scalene” describing the triangle type. If the input doesn’t create a valid triangle output “invalid!”. Follow the output format below.

Sample Input
2
3 3 4
6 4 2

Sample Output
Case #1: isosceles
Case #2: invalid!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?