提交时间:2024-08-19 22:06:12
运行 ID: 168056
#include <bits/stdc++.h> using namespace std; bool isPowerofTwo(int n){ if(n<= 0)return false; return(n&(n-1))== 0; } int main(){ int num; cin >> num; if(isPowerofTwo(num)){ cout <<"YES" } else { cout <<"NO"; } return 0; }