#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
using namespace std;
///十进制转二进制
long long tra(long long n)
{
int a[1000];
int c=0;
for(int i=0;n>=2;i++)
{
a[i]=n%2;
n=n/2;
c++;
}
printf("%lld",n);
for(int i=c-1;i>=0;i--)
{
printf("%lld",a[i]);
}
}
int main()
{
tra(5);
cout << '\n';
tra(6);
cout << '\n';
///与 0 强
cout << "0 & 1 : " << (0 & 1) << '\n';
cout << "0 & 0 : " << (0 & 0) << '\n';
cout << "1 & 1 : " << (1 & 1) << '\n';
cout << "5 & 6 : " << (5 & 6) << '\n';
///或 1 强
cout << "0 | 1 : " << (0 | 1) << '\n';
cout << "0 | 0 : " << (0 | 0) << '\n';
cout << "1 | 1 : " << (1 | 1) << '\n';
cout << "5 | 6 : " << (5 | 6) << '\n';
///异或 同为0 异为1
cout << "0 ^ 1 : " << (0 ^ 1) << '\n';
cout << "0 ^ 0 : " << (0 ^ 0) << '\n';
cout << "1 ^ 1 : " << (1 ^ 1) << '\n';
cout << "5 ^ 6 : " << (5 ^ 6) << '\n';
///非的结果只有0、1
cout << " !6 : " << !6 << '\n';
cout << " !5 : " << !5 << '\n';
cout << " !1 : " << !1 << '\n';
cout << " !0 : " << !0 << '\n';
cout << "8 >> 2 : " << (8 >> 2) << '\n';
cout << "8 << 2 : " << (8 << 2) << '\n';
return 0;
}