M - Fancy Fence

在这里插入图片描述
在这里插入图片描述

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    
    
    int t,a;
   cin>>t;
   while(t--)
   {
    
    
   	cin>>a;
    if(360%(180-a)==0)
    cout<<"YES"<<endl;
	else
	cout<<"NO"<<endl;
   }
    return 0;
}

需要知道:多边形的外角和为360°,且正多边形的内角不可能小于30°

猜你喜欢

转载自blog.csdn.net/weixin_51713993/article/details/114239018