1 条题解
-
0yangjz1125 LV 5 MOD @ 2018-02-06 14:32:14
#include <iostream> #include <bitset> #include <cmath> using namespace std; int main() { unsigned long long a,x; cin >> a >> x; cout << (unsigned long long)(a *pow(2,x) ) << endl << (a >> x) << endl; bitset<64> A(a); cout << A[x] << endl; bitset<64> tmp(A); tmp[x] = 1; cout << tmp.to_ulong() << endl; tmp[x] = 0; cout << tmp.to_ulong() << endl; A[x] = !A[x]; cout << A.to_ulong() << endl; }
- 1