Last active
July 17, 2016 13:38
-
-
Save Jack-Saleem/fa2aac3d7d71443d22f4 to your computer and use it in GitHub Desktop.
codeforces 270A FancyFence program in java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class FancyFence | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
int t=z.nextInt(); | |
int a[]=new int[t]; | |
String aa[]=new String[t]; | |
for(int i=0;i<a.length;i++) | |
a[i]=z.nextInt(); | |
for(int i=0;i<a.length;i++) | |
{ | |
int temp=0; | |
boolean flag=false; | |
while(temp<=360){ | |
if(temp==360){ | |
flag=true; | |
break; | |
} | |
temp+=180-a[i]; | |
} | |
if(flag) | |
aa[i]="YES"; | |
else | |
aa[i]="NO"; | |
} | |
for(String xx:aa) | |
System.out.println(xx); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment