#include <iostream> unsigned int reverseInt(int val) { unsigned int res = 0; for(int i = 0; i < 32; i++) { res <<= 1; res |= (val & 1); val >>= 1; } return res; }; int main() { unsigned int res = reverseInt(1); return 0; }
#include <iostream> unsigned int reverseInt(int val) { unsigned int res = 0; for(int i = 0; i < 32; i++) { res <<= 1; res |= (val & 1); val >>= 1; } return res; }; int main() { unsigned int res = reverseInt(1); return 0; }