sivan_iut

Untitled

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