Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- unsigned int x = 75;
- unsigned int y = 19;
- // for(int i=0; i<32; i++)
- // cout << "bitul "<< i << ':' << ((1<<i)&x ? '1' : '0') << '\n';
- for(int i=31; i>=0; i--)
- cout << ((1<<i)&x ? '1' : '0');
- cout <<" x";
- cout << '\n';
- for(int i=31; i>=0; i--)
- cout << ((1<<i)&y ? '1' : '0');
- cout <<" y";
- unsigned int si = x & y;
- cout << '\n';
- for(int i=31; i>=0; i--)
- cout << ((1<<i)&si ? '1' : '0');
- cout <<" x&y";
- unsigned int sau = x | y;
- cout << '\n';
- for(int i=31; i>=0; i--)
- cout << ((1<<i)&sau ? '1' : '0');
- cout <<" x|y";
- unsigned int notx = ~x;
- cout << '\n';
- for(int i=31; i>=0; i--)
- cout << ((1<<i)¬x ? '1' : '0');
- cout <<" ~x";
- unsigned int xshstg3 = x << 3;
- cout << '\n';
- for(int i=31; i>=0; i--)
- cout << ((1<<i)&xshstg3 ? '1' : '0');
- cout <<" x<<3" << " adica " << xshstg3;
- unsigned int shdr3 = 64 >> 3;
- cout << '\n';
- for(int i=31; i>=0; i--)
- cout << ((1<<i)&shdr3 ? '1' : '0');
- cout <<" 64>>3" << " adica " << shdr3;
- int a = -1;
- cout << '\n';
- for(int i=31; i>=0; i--)
- cout << ((1<<i)&a ? '1' : '0');
- cout <<" a" << " adica " << a;
- int b = -2;
- cout << '\n';
- for(int i=31; i>=0; i--)
- cout << ((1<<i)&b ? '1' : '0');
- cout <<" b" << " adica " << b;
- for(long long i=0; i<1289367100; i++)
- long long x = i*8;
- cout << '\n';
- cout << '\n';
- cout << '\n';
- cout << '\n';
- return 0;
- }
Add Comment
Please, Sign In to add comment