#include<iostream>
using namespace std;
void change(int n)
{
if(n>=0){
if(n/2==0)
cout << n%2;
else{
change (n/2);
cout << n%2 ;
}
}
else{
if(n/2==0)
cout << n%2;
else{
change (n/2);
int x=-n%2;
cout << x ;
}
}
}
int main()
{
int n;
cin>>n;
change(n);
return 0;
}
#include<iostream>
using namespace std;
void change(int n)
{
if(n>=0){
if(n/2==0)
cout << n%2;
else{
change (n/2);//使商进入递归函数中
cout << n%2 ;//输出余数
}
}
else{
if(n/2==0)
cout << n%2;
else{
change (n/2);
int x=-n%2;//防止输出时带负号
cout << x ;
}
}
}
int main()
{
int n;
cin>>n;//输入的数字可正可负
change(n);
return 0;
}