@sensitive-cs
2016-10-02T17:46:44.000000Z
字数 285
阅读 934
思路:
判断n对4,7这两个数的一位数,两位数,三位数的组合取余是否为零就ok。
#include <stdio.h>
int main()
{
int n;
while (scanf("%d",&n) != EOF)
{
if (n % 4 == 0 || n % 7 == 0 || n % 44 == 0 || n % 77 == 0 || n % 74 == 0 || n % 47 == 0 || n % 444 == 0 || n % 447 == 0 || n % 477 == 0 || n % 474 == 0 || n % 744 == 0 || n % 777 == 0 || n % 747 || n % 774 == 0)
printf("YES");
else
printf("NO");
}
return 0;
}