import java.util.*;
public class LuckyDivision {
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
String x=in.next();
String z;
boolean isLucky=false;
int num=Integer.parseInt(x);
int y=4;
while(y<=num){
if(num%y==0){
isLucky=true;
break;
}
y++;
for(;y<=num;y++){
z=String.valueOf(y);
if(!(z.contains("1")||z.contains("2")||z.contains("3")||z.contains("5")||z.contains("6")||z.contains("8")||z.contains("9")||z.contains("0"))){
break;
}
}
}
if(isLucky)
System.out.println("YES");
else {
System.out.println("NO");
}
}
}
注意:此种情况是针对于无上限的LuckyNumber的情况,在ACM时可以针对上限情况直接构造出符合条件的几个数即可
CodeForves-122A-LuckyDivisions
最新推荐文章于 2022-10-30 10:45:25 发布