文章
8
粉丝
0
获赞
44
访问
2.0k
#include <bits/stdc++.h>
using namespace std;
string tentotwo(string a)
{
string ans="";//二进制翻转
while(a!="0")
{
string c="";//商
int carry=0;
for(int i=0;i<a.size();i++)
{
int temp=carry*10+(a[i]-'0');
carry=temp%2;
c+=(temp/2+'0');
}
ans+=(carry+'0');
while(c.size()>1&&c[0]=='0')
{
c.erase(0,1);
&nbs...
登录后发布评论
暂无评论,来抢沙发