4->100
3->011
100 & 011 -> 0
#include<iostream>
using namespace std;
int main()
{
int n; //n>0
cin>>n;
if( n & (n-1) )
cout<<"no\n";
else
cout<<"yes\n";
return 0;
}
标签:std,判断,运算,int,namespace,是否是,011,100,main
来源: https://blog.csdn.net/weixin_52341477/article/details/122289064