提交时间:2024-08-19 20:40:30

运行 ID: 167911

#include <iostream> #include <algorithm> using namespace std; bool hh(int num) { if(num==0) return false; while( (num&1) ==0) num = num>>1; return num==1; } int main() { int n; int a[10000]; cin>>n; for (int i = 0; i < n; i++){ cin>>a[i]; } for (int i = 0; i < n; i++){ if(hh(a[i])) cout<<"Yes"<<endl; else cout<<"No"<<endl; } return 0; }