提交时间:2024-08-19 20:46:19

运行 ID: 167923

#include <iostream> #include <algorithm> using namespace std; bool hh(int num) { if(num<=1) return false; while( (num&1) ==0) num = num>>1; if(num==1) return 1; num=num>>1; 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; }