#C13179. Reverse Bits
Reverse Bits
Reverse Bits
Given an unsigned 32-bit integer \(n\), reverse its binary bits and return the resulting integer. In other words, consider the binary representation of \(n\) as a 32-character string with leading zeros if necessary, reverse this string, and then interpret the result as a binary number.
For example, for \(n = 43261596\), the 32-bit binary representation is 00000010100101000001111010011100
. Reversing this sequence produces 00111001011110000010100101000000
, which corresponds to the integer \(964176192\).
Your program should read the input from standard input (stdin) and print the output to standard output (stdout).
inputFormat
The input consists of a single line containing one unsigned 32-bit integer \(n\) (0 \(\leq n \leq 2^{32}-1\)).
outputFormat
Output the integer result obtained by reversing the binary representation of \(n\).
## sample43261596
964176192