提交时间:2024-08-20 21:49:16

运行 ID: 173587

#include <bits/stdc++.h> using namespace std; bool is(int n) { if (n < 3) { return false; } int cnt = 0; while (n > 0) { if (n & 1) { cnt++; } n >>= 1; } return cnt == 2; } int main() { int t; cin >> t; for (int i = 0; i < t; i++) { int n; cin >> n; if (is(n)) { cout << "yes" << endl; } else { cout << "no" << endl; } } return 0; }