All submissions for this problem are available.
Write a program to check whether a triangle is valid or not, when the three angles of the triangle
are the inputs. A triangle is valid if the sum of all the three angles is equal to 180 degress.
The first line contains an integer T, total number of testcases. Then follow T lines, each line contains three angles A, B and C of triangle separated by space.
Display 'YES' or 'NO' if the triangle is Valid or not respectively.
- 1 ≤ T ≤ 1000
- 0 ≤ A,B,C ≤ 180
Input 3 40 40 100 45 45 90 180 0 0 Output YES YES NO
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.