Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
题意:将阿拉伯数字转换为罗马数字表示
思路:首先了解罗马数字的表示,然后就是从大到小找符合的数字了
class Solution {
public:
strin...
分类:
其他好文 时间:
2015-01-19 15:52:35
阅读次数:
137
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42713315
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to...
分类:
其他好文 时间:
2015-01-15 20:27:53
阅读次数:
226
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
题目的意思是将给定的罗马数字转换为一个整数
什么是罗马数字:
I, II, III, IV, V, VI, VII, VIII, IX, X....
分类:
其他好文 时间:
2015-01-15 20:19:12
阅读次数:
205
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
将罗马数字转为阿拉伯数字 对应转换表如下:
个位数举例
I, 1 】II, 2】 III, 3】 IV, 4 】V, 5 】VI, 6】 VII, 7】 VIII,8 】IX,...
分类:
编程语言 时间:
2015-01-15 16:08:07
阅读次数:
188
Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ简单的罗马数字见下: I - 1 II - 2 III - 3 IV - 4 V - 5 VI - 6 X - 10 L - 50 C - 100 D - 500 M - 1000 罗马数字共同拥有七个,即I(1),V(5),X(10),L(50),C(100)...
分类:
其他好文 时间:
2015-01-13 21:32:11
阅读次数:
231
原题链接:https://oj.leetcode.com/problems/integer-to-roman/
这题也是简单题,重点是要维持一个罗马数字的数组,然后每位计算时候,则数组往后扫2位,使用同样的计算方式得出当前位的罗马表示。
class Solution {
public:
string intToRoman(int num) {
char ...
分类:
其他好文 时间:
2015-01-12 16:36:48
阅读次数:
170
Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.罗马数字的组数规则,有几条须注意掌握;(1)基本数字Ⅰ、...
分类:
其他好文 时间:
2015-01-03 18:28:19
阅读次数:
174
Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.罗马数字有如下符号:基本字符IVXLCDM阿拉伯数字15...
分类:
其他好文 时间:
2014-12-25 00:03:39
阅读次数:
266
这个题目很简单,只是不了解数字与罗马数字转换关系的话就无从下手了。
题目:
原理与思路:
罗马数字有如下符号:
基本字符
I
V
X
L
C
D
M
对应阿拉伯数字
1
5
10
50
100
500
1000
计数规则:
相同的数字连写,所表示的数等于这些数字相加得到的数...
分类:
其他好文 时间:
2014-12-20 10:30:21
阅读次数:
244
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
class Solution {
public:
int romanToInt(string s) {
int weight[26];
...
分类:
其他好文 时间:
2014-12-19 14:30:53
阅读次数:
160