Codeforces Round #165 (Div. 2) A - Fancy Fence

Topic: http: //codeforces.com/contest/270/problem/A

Input angle, determines whether the configuration of a regular polygon

Thinking: n-gon satisfied satisfies angle: angle = (n-2) * 180 / n

#include <iostream>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while (t--)
    {
        int n;
        cin>>n;
        if(360%(180-n)) cout<<"NO"<<endl;
        else cout <<"YES"<<endl;
    }
}

 

Reproduced in: https: //www.cnblogs.com/danielqiu/archive/2013/02/02/2890268.html

Guess you like

Origin blog.csdn.net/weixin_33763244/article/details/93795300