24 lines
271 B
C++
24 lines
271 B
C++
|
|
#include<iostream>
|
||
|
|
using namespace std;
|
||
|
|
|
||
|
|
int main()
|
||
|
|
{
|
||
|
|
int n=12;
|
||
|
|
int i,j=0;
|
||
|
|
int a[1000];
|
||
|
|
|
||
|
|
i=n;
|
||
|
|
while(i)
|
||
|
|
{
|
||
|
|
a[j]=i%2;
|
||
|
|
i/=2;
|
||
|
|
j++;
|
||
|
|
}
|
||
|
|
for(i=j-1;i>=0;i--)
|
||
|
|
{
|
||
|
|
cout<<a[i];
|
||
|
|
}
|
||
|
|
cout<<endl;
|
||
|
|
return 0;
|
||
|
|
}
|