Playground
#include <iostream> #include <bitset> using namespace std; int main() { bitset<6> bs1; //bs1= 000000 bitset<6> bs2 (string("010101")); //bs2="010101 cout << bs2.count() << endl; //pechati '3' //poziciite se brojat od desno na levo (pochnuvajki so 0) bs1[0] = bs1[1] = bs2[0]; //bs1= 000011 bs1 &= bs2; //bs1= 000001 bs1 <<= 2; //bs1= 000100 cout << bs1 << endl; //pechati '000100' return 0; }
Input data
Program output
no input
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!