Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: http://en.wikipedia.org/wiki/Right_triangle.
[3 4 5] ---> true
[5 12 13] ---> true
[5 5 5] ---> false
how is [5 5 5] false?
[5 5 5] can make a triangle, but not a *right* triangle (with one 90-degree angle). See the Wikipedia page definition.
This problem, and more similar but difficult ones, are covered in depth in the CUP challenge
not a solution to the problem. solution to the testcases.
I added a test case to nullify this "solution".
right triangle>a triangle with one 90 degree_angle?from this point,we can see the expression power of English sucks when compared to that of chinese
FYI, "right triangle" is American English, "right-angled triangle" (or "right-angle triangle") is British English. Neither expression reflects the 'power' of the language.
This presupposes issorted([a b c]).
What is the distance from point P(x,y) to the line Ax + By + C = 0?
How to subtract?
Swap two numbers
Remove the Zero
Matlab Basics - y as a function of x
Sum my indices
Factorize THIS, buddy
Maintain shape of logical-index mask
Figurate number triangle
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office