Advertisement
amine99

Untitled

Feb 28th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int x,n,i;
  5.     scanf("%d",&n);
  6.  
  7.     for (i=0;i<n;i++)
  8.     {
  9.       scanf("%d",&x);
  10.       while(x >= 3 && x % 7 != 0)
  11.          x -= 3;
  12.       if(x == 0 || x % 7 == 0)
  13.          printf("YES\n");
  14.       else
  15.           printf("NO\n");
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement