Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int N;
- scanf("%d",&N);
- int remainder;
- int a;
- int COUNT=0;
- int S;
- S=N;
- while(N!=0)
- {
- N=N/10;
- ++COUNT;
- }
- while(S!=0)
- {
- remainder=S%10;
- S=S/10;
- if(remainder==4 || remainder==7)
- a++;
- if(remainder!=4 || remainder!=7)
- break;
- }
- if(a==COUNT)
- printf("YES");
- else if(S%4==0 || S%7==0)
- printf("YES");
- else
- printf("NO");
- return 0;
- }
Add Comment
Please, Sign In to add comment