2015年9月23日 星期三

Two floating numbers 四捨五入


Input two floating numbers X and P.

a. 0 < X <1
b. P = 1 / 0.1 / 0.01/ 0.001
c. answer format %.4f

ex:
if X is 0.5678 and P is 0.01, then the answer is 0.5700
if X is 0.1269 and P is 0.1, then the answer is 0.1000

2015年9月17日 星期四

C int mapping string


Encoding scheme defined by the following mapping: 

1->'A',
2->'B',
3->'C',
...,
9->'I',
0->'J'.

Input A three-digit integer N

Output The encoding result