The cyclic basis of programming basis-polygon inner angle and;

Source: Internet
Author: User

Describe

In Euclidean geometry, the inner angle of the N-edged shape is (n-2) *180°. Given the degrees of the inner angles (n-1), it is possible to calculate the degree of the remaining unknown inner angle. Please write a program to solve this problem.

Enter line 1th with only one integer n (2<n<1000), which is the number of sides of the polygon.
The 2nd line has (n-1) a positive integer, which is the degree of each known inner angle. Adjacent two integers are separated by a single space.
Data guarantees that a given polygon is valid. Outputs a positive integer that is the degree of the unknown inner angle. Sample input

345 60

Sample output

75
1#include <iostream>2#include <cstdio>3 using namespacestd;4 intMain ()5 {6     inta,x,b;7     //double x;8Cin>>A;9B= (A-2)* the;Ten      for(intI=0; i<a-1; i++) One     { ACin>>x; -b-=x; -     }     theprintf"%d", B);  -     return 0; -}

The cyclic basis of programming basis-polygon inner angle and;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.