Files
python/TangDou/LuoGuBook/TD copy.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

14 lines
301 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int x = 15;
vector<int> path; // 动态数组
while (x) {
int a = x % 2;
path.push_back(a);
x /= 2;
}
for (int i = path.size() - 1; i >= 0; i--)
cout << path[i];
return 0;
}