Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <complex>
- using namespace std;
- int main() {
- int n, a;
- cin >> n;
- a = -1;
- while (pow(2, a) <= n) {
- a = a + 1;
- if (pow(2, a) >= n) {
- break;
- }
- } if (pow(2, a) == n) {
- cout << "YES";
- } else cout << "NO";
- }
Advertisement
Add Comment
Please, Sign In to add comment