#K12991. Sum of Interior Angles of Multiple Polygons
Sum of Interior Angles of Multiple Polygons
Sum of Interior Angles of Multiple Polygons
Given a series of polygons, each defined by the number of sides n, compute the sum of its interior angles using the formula ( S = (n-2) \times 180 ) degrees. The input is provided through standard input, one integer per line. The sequence ends when the integer 0 is encountered (0 should not be processed).
inputFormat
Input is given via standard input. Each line contains a single integer representing the number of sides of a polygon. The sequence of integers is terminated by a 0, which signals the end of input and should not be processed.
outputFormat
For each polygon (except the terminating 0), output a single line displaying the sum of its interior angles.## sample
3
0
180