文章
246
粉丝
0
获赞
1202
访问
193.4k
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
int t;
string str;
ll get_num()
{
ll sum=0;
for(int i=0;i<str.size();i++)
{
int x=str[i]-'0';
sum=sum*2+x;
}
return sum;
}
void make_num(ll x,string &s)
{
while(x)
{
int t=x%2;
s.push_back('0'+t);
x/=2;
}
while(s.size()<32)
s.push_back('0');
reverse(s.begin(),s.end());
}
int main()
{
cin>>t;
while(t--)
{
cin>>str;
ll n=get_num();
string res1,res2;
make_num(n+1,res1);
make_num(n+3,res2);
cout<<res1<<endl;
cout<<res2<<endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发