#include "stdio.h"
int main()
{
int i;
int j = 128;
scanf("%d", &i);
while(j > 1)
{
if(i/j == 1)
{
printf("1");
}
else
printf("0");
i = i % j;
j = j/2;
}
printf("%d", i);
}
#include
void tobin(char x)
{
int i;
char bin[8];
for(i = 7; i >= 0; i--)
{
bin[i] = x&1;
x = x>>1;
}
for(i = 0; i < 8; i++)
{
printf("%d", bin[i]);
}
printf("\n");
}
int main()
{
unsigned char a = 254;
tobin(a);
return 0;
}
main()
{
unsigned char a;
scanf("%d",&a);
printf("%o", a);
}
#include
using namespace std;
int main()
{
int n;
cout << "input n:";
cin >> n;
for(int i=1; i<=8; i++){
cout << (n<0?1:0) << (i%8==0?" ":"");
n = n<<1;
}
cout << endl;
}