#13973. [GESP202609 三级 C++] 第 5 题

[GESP202609 三级 C++] 第 5 题

下面程序执行的结果是( )。

#include <iostream>
using namespace std;
int main() {
    int x = 2026;
    int count = 0;
    while (x > 0) {
        count++;
        x = x & (x - 1);
    }
    cout << count << endl;
}

{{ select(1) }}

  • 2026
  • 8
  • 16
  • 32