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(s...
分类:
其他好文 时间:
2015-01-23 00:54:13
阅读次数:
207
【题目】
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
【分析】
这是一种首先会想到的思路:一个一个字母解析,先解析是不是双字母罗马数字,如果不是就按单字母罗马数字解析。
【代码】
/***********...
分类:
其他好文 时间:
2015-01-22 15:26:52
阅读次数:
134
【题目】
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
【分析】
I = 1;
V = 5;
X = 10;
L = 50;
C = 100;
D = 500;
M = 1000;
还有一些特...
分类:
其他好文 时间:
2015-01-21 18:12:13
阅读次数:
154
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999. 1 public class Solution { 2 public Stri...
分类:
其他好文 时间:
2015-01-19 20:53:28
阅读次数:
146
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
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'https://oj.leetcode.com/problems/roman-to-integer/Roman to IntegerGiven a roman numeral, c...
分类:
编程语言 时间:
2015-01-19 06:46:47
阅读次数:
172
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'https://oj.leetcode.com/problems/integer-to-roman/Integer to RomanGiven an integer, conver...
分类:
编程语言 时间:
2015-01-18 07:04:05
阅读次数:
194
本文是在学习中的总结,欢迎转载但请注明出处: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 an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
将阿拉伯数字转换为罗马字符
建立一个二维数组来代表转换表 代码如下:
public class Solution {
public String intToR...
分类:
编程语言 时间:
2015-01-15 18:21:16
阅读次数:
186