文章
10
粉丝
9
获赞
0
访问
3.8k
#include<bits/stdc++.h>
using namespace std;
void f(int x){
char out[105];
int cnt = 0;
if(x == 0){
printf("0\n");
return;
}
while (x != 0) {
int cur = x % -2;
if (cur < 0) {
cur += 2;
x = (x / -2) + 1;
} else {
x /= -2;
}
out[cnt++] = cur + '0';
}
for (int i = cnt - 1; i >= 0; i--){
printf("%c", out[i]);
}
printf("\n");
}
int main...
登录后发布评论
暂无评论,来抢沙发