Advertisement
Promi_38

cf 1223A

Oct 2nd, 2021
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int t;
  8.     scanf("%d", &t);
  9.    
  10.     while(t--)
  11.     {
  12.         int n;
  13.         scanf("%d", &n);
  14.        
  15.         if(n == 2) printf("2\n");
  16.         else if(n % 2 == 0) printf("0\n");
  17.         else printf("1\n");
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement