【Henu ACM Round#20 A】 Fancy Fence

【链接】 我是链接,点我呀:)
【题意】

在这里输入题意

【题解】

看看有没有(n-2)*180/n等于输入的a就好。

【代码】

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int T;
    cin >> T;
    while (T--){
        int a;
        cin >> a;
        bool ok = false;
        //(n-2)*180/n
        for (int n = 3; ;n++){
            int temp = (n-2)*180;
            if(temp%n==0){
                if (temp/n==a){
                    cout<<"YES"<<endl;
                    ok = true;
                    break;
                }
                if (temp/n==179) break;
            }
        }
        if (!ok){
            cout<<"NO"<<endl;
        }
    }
    return 0;
}
原文地址:https://www.cnblogs.com/AWCXV/p/8404236.html