sivan_iut

Untitled

Feb 24th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int n;
  5.     scanf("%d",&n);
  6.     int r,a;
  7.     while(n!=0)
  8.     {
  9.             r=n%10;
  10.             n=n/10;
  11.             if(r!=4 || r!=7)
  12.             {
  13.             printf("NO");
  14.             a++;
  15.             break;
  16.             }
  17.     }
  18.     if(a==0)
  19.     {
  20.         if(n%4==0 || n%7==0)
  21.         printf("YES");
  22.         else
  23.             printf("NO");
  24.     }
  25.  
  26.  
  27.     return 0;
  28. }
Add Comment
Please, Sign In to add comment