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

题目:http://codeforces.com/contest/270/problem/A

输入角度,判断能否构成正多边形

思路:正n边形满足的角满足: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;
    }
}

转载于:https://www.cnblogs.com/danielqiu/archive/2013/02/02/2890268.html

猜你喜欢

转载自blog.csdn.net/weixin_33763244/article/details/93795300