看了题解思路自己打的代码
#include <bits/stdc++.h> using namespace std; #define int long long int n; signed main() { int T; cin>>T; while(T--) { scanf("%d",&n); while(n%2==0) { n/=2; } if(n==1||n-2==1) cout<<"0\n"; else cout<<"1\n"; } return(0); }