UVa 10473

From Algorithmist
Jump to: navigation, search

10473 - Simple Base Conversion[edit]

Summary[edit]

Given a decimal of a hexadecimal number denoted by '0x' output hex for decimal number and decimal for hex number

Explanation[edit]

  • Read in the line as a string and parse it.

Implementations[edit]

Gotchas[edit]

ANY negative number ends input.

Input[edit]

2147483647
4
7
44
0x80685
-1

Output[edit]

0x7FFFFFFF
0x4
0x7
0x2C
525957

References[edit]