wes d2a2ba9e15 first commit | 4 anni fa | |
---|---|---|
.. | ||
README.md | 4 anni fa | |
code.cpp | 4 anni fa | |
unitTest.cpp | 4 anni fa |
by Helen Yu tags: algebra, numbers, math
You are given 2 out of 3 of the angles in a triangle, in degrees. Write a function that classifies the missing angle as either "acute", "right", or "obtuse" based on its degrees. An acute angle is less than 90 degrees. A right angle is exactly 90 degrees. An obtuse angle is greater than 90 degrees (but less than 180 degrees). For example: missingAngle(11, 2
You are given 2 out of 3 angles in a triangle, in degrees.
Write a function that classifies the missing angle as either "acute"
, "right"
, or "obtuse"
based on its degrees.
For example: missingAngle(11, 20)
should return "obtuse"
, since the missing angle would be 149 degrees, which makes it obtuse.
missingAngle(27, 59) ➞ "obtuse"
missingAngle(135, 11) ➞ "acute"
missingAngle(45, 45) ➞ "right"
The sum of angles of any triangle is always 180 degrees.