码迷,mamicode.com
首页 >  
搜索关键字:roman to integer    ( 15811个结果
奇葩的细节
public class Test { public static void main(String[] string){ int i = Integer.MAX_VALUE; System.out.println(i); ...
分类:其他好文   时间:2014-05-15 10:13:33    阅读次数:224
关于Interget
String s="32"; int i=Integer.parseInt(s); System.out.println(i);这样没有问题 String s="3g"; int i=Integer.parseInt(s); Sy...
分类:其他好文   时间:2014-05-15 09:23:50    阅读次数:234
leetcode第一刷_Integer to Roman
这道题当时不会写,是参照discuss写的。 首先要弄明白罗马数字的规则,这个在国外难道是常识吗,为什么题干一点都没讲。。 4000以下一共有下面几种符号:"M", "D", "C", "L", "X", "V", "I",对应到我们十进制为:1000, 500, 100, 50, 10, 5, 1。还有一条非常重要的规则,就是同样的字符最多重复出现三次。这就决定了数位上带4和9的跟普通的数值...
分类:其他好文   时间:2014-05-15 00:02:06    阅读次数:391
Leetcode 数 String to Integer (atoi)
1.注意规则 2.注意最小的负数的绝对值比最大的正数的绝对值大1,所以 line 13: (str[i] - '0') > INT_MAX%10不能取等号...
分类:其他好文   时间:2014-05-14 23:52:26    阅读次数:478
[LeetCode]Roman to Integer
Roman to Integer 罗马数字转化为整数...
分类:其他好文   时间:2014-05-14 23:49:52    阅读次数:515
Delphi XE6记录类型赋值
program Project1;{$APPTYPE CONSOLE}{$R *.res}uses System.SysUtils;TYPE Trec = record Member1, Member2: Integer; end;CONST IntRec: Trec = (Member1: 55;...
分类:其他好文   时间:2014-05-14 23:18:51    阅读次数:554
VBA 以文本格式打开DSV
Public Function GetDataFromDSV(fpath As String) As Collection Dim AllTextFormat(255) As Integer Dim i As Long For i = 0 To 255 AllTextF...
分类:其他好文   时间:2014-05-14 22:32:10    阅读次数:470
LeetCode 008 String to Integer (atoi)
【题目】 Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases. Notes: It is intended for this problem to be s...
分类:其他好文   时间:2014-05-14 21:00:57    阅读次数:304
LeetCode 007 Reverse Integer
【题目】 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 【题意】 反转int型整数,输出的也是int型的整数 【思路】 如要考虑两种特殊情况: 1. 类似100这样的整数翻转之后为1 2. 翻转之后的值溢出该如何处理, 本题的测试用例中似乎没有给出溢出的情况 ...
分类:其他好文   时间:2014-05-14 20:41:19    阅读次数:244
LeetCode 009 Palindrome Number
【题目】 Determine whether an integer is a palindrome. Do this without extra space. 【题意】 题意判断一个整数是否是回文数 注意一下几点: 1. 不能用额外的空间 2. 负数不是回文数...
分类:其他好文   时间:2014-05-14 20:31:10    阅读次数:298
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!