#include <iostream>
using namespace std;
void updateIthBit(int num, int i, int val) {
// clear ith bit
num = num & ~(1<<i);
//numbitmask
num = num | (val << i);
cout << num << endl;
}
int main()
{
updateIthBit(7, 3, 1);
return 0;
}
Yes. I found an available transcript of the video and summarized it simply. The video is “How To Become Red Coder? (codeforces.com)” by Err...
No comments:
Post a Comment