CCONST - C style constants
For each input line, interpret if it as a hexadecimal number (if it begins with 0x), an octal number (if it begins with 0), and a decimal number otherwise, and output its value in decimal.
Score is the length of your source.
Input
The input file consists of series of numbers (as described above) one in each line.
The input is terminated by EOF.
Output
The decimal value of the given number.
Example
Input: 0146 0xcd 0x188 0611 0x37d 0x0 0x1 01 1 0x2 Output: 102 205 392 393 893 0 1 1 1 2
PS: Take care about your fingers, do not use more than 128 bytes of code.
hide comments
bashrc is back:
2011-01-29 07:00:16
@admin can you please check where my source code is going wrong.apologies if asking for too much Last edit: 2011-01-29 08:12:42 |
Added by: | :(){ :|: & };: |
Date: | 2010-10-04 |
Time limit: | 8.800s |
Source limit: | 128B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | From a shortening contest |