提交时间:2023-08-21 16:23:09

运行 ID: 99030

#include<bits/stdc++.h> using namespace std; int t,n; string solveb(int t,int r){ string ans=""; while(t!=0){ int f=t%r; t/=r; if(f<10){ ans=((char)(f+'0'))+ans; } else{ ans=((char)((f-10)+'A'))+ans; } } return ans; } int main(){ cin>>t; while(t--){ int cnt=0; cin>>n; string k=solveb(n,2); for(int i=0;i<k.size();i++){ if(k[i]=='1') cnt++; } if(cnt<=2) cout<<"yes"<<endl; else cout<<"no"<<endl; } return 0; }