原题链接:https://oj.leetcode.com/problems/roman-to-integer/
比较简单的题,代码应该还可以稍微优化,更generic一些。
class Solution {
public:
int romanToInt(string s) {
if (s.size() == 0) return 0;
...
分类:
其他好文 时间:
2015-01-12 16:38:48
阅读次数:
122
原题链接:https://oj.leetcode.com/problems/integer-to-roman/
这题也是简单题,重点是要维持一个罗马数字的数组,然后每位计算时候,则数组往后扫2位,使用同样的计算方式得出当前位的罗马表示。
class Solution {
public:
string intToRoman(int num) {
char ...
分类:
其他好文 时间:
2015-01-12 16:36:48
阅读次数:
170
List jfAuctionListValue=new ArrayList(); Map jfAuctionMap = new HashMap(); for (Integer key : jfAuctionMap.keySet()) { jfAuctionListValue.add(jfAucti....
分类:
其他好文 时间:
2015-01-12 15:54:55
阅读次数:
180
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
For example,
Given n = 3,
You should return the following matrix:
[
[ 1, 2, 3 ],
[ 8, 9, 4 ],
[...
分类:
其他好文 时间:
2015-01-12 14:42:40
阅读次数:
222
public List getListScoreByJfEventId(Integer jfEventId){ List jfAuctionList=null; String hql ="select j.id,j.user,j.jfEvent,sum(j.score),j.status,j.cre...
分类:
其他好文 时间:
2015-01-12 14:39:32
阅读次数:
154
public int getMaxScoreByJfEventIdNumber(Integer jfEventId) { int numberValue=0; String hql = "from JfAuction where jfEvent.id =:jfEventId"; Finder fi....
分类:
其他好文 时间:
2015-01-12 14:37:53
阅读次数:
144
public JfAuction getMaxScoreByJfEventId(Integer jfEventId) { JfAuction jfAuction=null; String hql = "from JfAuction where jfEvent.id =:jfEventId and ....
分类:
其他好文 时间:
2015-01-12 14:28:06
阅读次数:
154
函数本质上是一个有名字的程序块,程序块使得多条语句可以一起执行。变量类型:1、复杂类型:Object、Array等。2、原始类型:String、Integer等。函数参数:1、复杂类型:传递引用。2、原始类型:传递值(拷贝)。函数类型:1、函数声明:在解析的时候,被提升至当前作用域的顶端,永远不要在...
分类:
编程语言 时间:
2015-01-12 10:38:44
阅读次数:
190
Determine whether an integer is a palindrome. Do this without extra space.
click to show spoilers.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of convertin...
分类:
其他好文 时间:
2015-01-12 00:25:55
阅读次数:
197
方法1:function test(var a,b,c:integer):integer;beginend;方法2:type info = record name:string; age : integer; end;function test():info;v...