Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i[14] = {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192};
  8. int n, k = 0;
  9. cin >> n;
  10. for (int t = 0; t <= 13; t++)
  11. {
  12. if (n == i[t])
  13. k++;
  14. }
  15. if ( k == 1)
  16. cout << "YES";
  17. else
  18. cout << "NO";
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement