anhkiet2507

SoLocPhat

Apr 17th, 2021
2,045
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.79 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. const int MAX = 100 ;
  4. int i;
  5. long long x , y=0;
  6. void NhapMang(long long a[], int n){
  7.     for(i = 0;i < n; ++i){
  8.         scanf("\n%lld", &a[i]);
  9.     }
  10. }
  11.  
  12. void XuatMang(long long a[], int n){
  13.     for(i = 0;i < n; ++i){
  14.         int check;
  15.         while(a[i]>0) {
  16.             check = 0;
  17.             x = a[i]%10;
  18.             a[i] = a[i]/10;
  19.             if(x!=0 && x!=6 && x!=8){
  20.                 check = 1;
  21.             }
  22.         }
  23.         if (check == 1) {
  24.             printf("\n%s", "NO");
  25.         }
  26.         if (check == 0) {
  27.             printf("\n%s", "YES");
  28.         }
  29.     }
  30. }
  31. int main()
  32. {
  33.     long long arr[MAX];
  34.     int n;
  35.     do{
  36.         scanf("%d", &n);
  37.         if(n <= 0 || n > MAX){
  38.             return 0;
  39.         }
  40.     }while(n <= 0 || n > MAX);
  41.     NhapMang(arr, n);
  42.     XuatMang(arr, n);
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment