reverse权威
2026-06-01 08:40:42
发布于:江苏
22阅读
0回复
0点赞
reverse还是太权威了
#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
int n;
cin >> n;
while (n>0) {
s+=char(n%2+'0');
n /= 2;
}
reverse(s.begin(),s.end());
cout<<s;
return 0;
}
这里空空如也







有帮助,赞一个