#11755: 括弧笑


curtis123 (curtis)


#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {

int n;
while(cin>>n)
{
int ans[100],i;
for(i=0;i<100;i++)
{
if(n==0)
break;
else
{
ans[i]=n%2; //存入 n/2 的餘數
n/=2; //將 n/2 的商再代回去算
}
}

for(int j=i-1;j>=0;j--) //倒回去列出
cout<<ans[j];

cout<<endl;
}
return 0;
}