#C8317. Taco Number Conversion Representations
Taco Number Conversion Representations
Taco Number Conversion Representations
You are given m integers. For each integer, you need to compute its binary, octal, and hexadecimal representations. In each representation, do not include the language-specific prefix (for example, in Python the prefix 0b
for binary should be removed).
For an integer \( n \), its binary representation is given by \( bin(n) = \sum_{i=0}^{k} b_i \times 2^i \) (when viewed from right-to-left), the octal and hexadecimal representations correspond similarly.
Your program should read the data from standard input and print the output to standard output. For each number, output 4 lines:
- The number itself.
- A line in the format:
Binary: [binary representation]
- A line in the format:
Octal: [octal representation]
- A line in the format:
Hexadecimal: [hexadecimal representation]
Separate the output for different numbers with a blank line (i.e. an empty line).
inputFormat
The first line contains an integer \( m \), representing the number of integers to process. This is followed by \( m \) lines, each containing one integer \( n \).
outputFormat
For each integer, print four lines:
- The original integer.
- A line:
Binary: [binary representation]
- A line:
Octal: [octal representation]
- A line:
Hexadecimal: [hexadecimal representation]
Separate the output for different integers with a blank line.
## sample3
10
255
1024
10
Binary: 1010
Octal: 12
Hexadecimal: a
255
Binary: 11111111
Octal: 377
Hexadecimal: ff
1024
Binary: 10000000000
Octal: 2000
Hexadecimal: 400
</p>