407183: GYM102697 154 BCD Conversion

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

154. BCD Conversiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Binary Coded Decimal(BCD) is a method of representing a value with binary notation while using the same digit places as base 10(decimal). For example, the value 783 in decimal translates to 1100001111 in standard binary, though it would instead translate to 011110000011 in binary converted decimal. This BCD converted value is composed of three chunks of 4 bits each, where each 4-bit chunk corresponds to a different digit from 783. While BCD is not used as commonly in software development, it is critical in 7-segment display systems. These circuits display a multi-digit number by splitting it into its individual digits, then sending each individual digit to a different display, creating the image of an entire number with multiple digits. Your task for this problem will be to take a base-ten decimal and to convert it into a BCD value. Each base-10 digit should be represented by four binary digits, and the individual chunks should be concatenated together to produce the final output.

Input

A single integer value that represents the value to be converted to BCD.

Output

A single binary value that represents the inputted value after being converted to BCD.

ExampleInput
7193
Output
0111000110010011

加入题单

算法标签: