前言
本文介绍了 LeetCode 第 13 题 , “Roman to Integer”, 也就是 “罗马数字转整数” 的问题.
本文使用 C# 语言完成题目。
题目
English
LeetCode 13. Roman to Integer
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
For example, two is written as II in Roman numeral, just two one’s added together. Twelve is written as, XII, which is simply X + II. The number twenty seven is written as XXVII, which is XX + V + II.
Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five we subtract it making four. The same principle applies to the number nine, whic

最低0.47元/天 解锁文章
2427

被折叠的 条评论
为什么被折叠?



