Skip to content

Instantly share code, notes, and snippets.

@Jack-Saleem
Created January 15, 2016 14:47
Show Gist options
  • Save Jack-Saleem/2abc409373b1ad1b9265 to your computer and use it in GitHub Desktop.
Save Jack-Saleem/2abc409373b1ad1b9265 to your computer and use it in GitHub Desktop.
Codeforces 122A LuckyDivision program in java
import java.util.Scanner;
public class LuckyDivision
{
public static void main(String[] args)
{
Scanner z=new Scanner(System.in);
int a=z.nextInt();
int[] l={4,7,44,47,74,77,444,447,474,477,744,747,774,777};
int ctr=0;
for(int ll:l)
{
if(a%ll==0)
ctr++;
}
if(ctr>0)
System.out.println("YES");
else
System.out.println("NO");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment