Question: 2 The Types of Triangle (10 marks) Given the length of three edges of the triangle, please design a program to judge the type of

2 The Types of Triangle (10 marks) Given the length of three edges of the triangle, please design a program to judge the type of a triangle. And the types are right triangle, equilateral triangle, isosceles triangle or ordinary triangle. Input: the non-negative lengths of edges of a set of triangles. Each line specifies the lengths of three edges of each triangle, and lengths are less than 100. -1 means the end of the input. Output: the types of triangles. The types are "Right Triangle," Equilateral Triangle," Isosceles Tri- angle", "Ordinary Triangle" or "Not a triangle". Example: Input: 5 4 3 1 -1 Output: "Equilateral Triangle" "Right Triangle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
