2011年10月22日 星期六

759 - The Return of the Roman Empire


Input and Output

請你寫一個程式將羅馬數字轉換成阿拉伯數字輸出。羅馬數字中 I=1, V=5, X=10, L=50, C=100, D=500, M=1000,且IV=4, IX=9, XL=40, XC=90, CD=400, CM=900。當羅馬數字格式錯誤時請輸出"This is not a valid number"。

Sample Input 

MCMXCVIII
CCM

Sample Output 

1998
This is not a valid number


原文出處

沒有留言:

張貼留言