Q:Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
该题是要将罗马数字转换成integer。罗马数字的定义可见维基百科:Roman numerals .
罗马数字是基于下面7个符号:
罗马数字的1...
分类:
其他好文 时间:
2015-02-03 11:09:32
阅读次数:
152
Ancient Cipher
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 29154
Accepted: 9547
Description
Ancient Roman empire had a strong government system with ...
分类:
其他好文 时间:
2015-02-03 09:31:15
阅读次数:
128
How Many Tables
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 14 Accepted Submission(s) : 12
Font: Times New Roman | Verdana | Georgia
...
分类:
其他好文 时间:
2015-02-02 23:18:44
阅读次数:
251
原题地址罗马数字的问题可以参考这篇博文,讲的很清楚代码: 1 int transfer(char c) { 2 switch (c) { 3 case 'I': return 1; 4 case 'V': return 5; 5 case 'X': return 10; 6 ca...
分类:
其他好文 时间:
2015-02-02 21:15:45
阅读次数:
141
uva 1339 Ancient Cipher
Ancient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and th...
分类:
其他好文 时间:
2015-02-01 13:35:46
阅读次数:
202
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
HideTags
Math String
class Solution {
public:
string intToRoman(int num)
{
int ...
分类:
其他好文 时间:
2015-01-31 12:49:10
阅读次数:
141
首先简单介绍一下罗马数字,一下摘自维基百科
罗马数字共有7个,即I(1)、V(5)、X(10)、L(50)、C(100)、D(500)和M(1000)。按照下述的规则可以表示任意正整数。需要注意的是罗马数字中没有“0”,与进位制无关。一般认为罗马数字只用来记数,而不作演算。
重复数次:一个罗马数字重复几次,就表示这个数的几倍。右加左减:在较大的罗马数字的右边记上较小的罗马数字,表示大数字加小数...
分类:
其他好文 时间:
2015-01-31 12:48:17
阅读次数:
140
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
请参考上一篇博文:http://blog.csdn.net/chenxun_2010/article/details/43274049roman to int:
class...
分类:
其他好文 时间:
2015-01-30 16:11:05
阅读次数:
116
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
这题的做法和前面一体interger to roman 类似 建一个dictionary 去查询。
1.先把string 反转
2. 用一个last去保存上一次的di...
分类:
编程语言 时间:
2015-01-30 10:53:17
阅读次数:
293
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
建两个list依次match 罗马数字。 比较特殊的是 一些有两位的罗马数字。
来自http://www.cnblogs.com/zuoyuan/p/377958...
分类:
编程语言 时间:
2015-01-30 10:51:44
阅读次数:
190