-4
import java.util.*;
import java.io.*;

public class pool 
{ 
    public static void main(String args[])throws IOException 
    { 
        Scanner in=new Scanner(System.in); 
        int t=in.nextInt(); 
        for(int i=1;i<=t;i++)
        { 
            int a=in.nextInt(); 
            if ((360.0/(180-a))==Math.round((360.0/(180-a))))
                System.out.println("yes"); 
            else 
                System.out.println("NO"); 
        }
    }
}
4

1 回答 1

1

360/(180-a)您可以通过比较和消除对 round 和浮点算术的调用(540-a)/(180-a)

的地板360.0/(180.0-a)+1.0将与 相同Math.Round(360.0/(180.0-a)。使用一些简单的代数等于(540-a)/(180-a),该值的下限将是使用整数算术时的结果。

当然,这并不能保证您发布的时间限制。

于 2013-04-10T22:13:29.620 回答