Reverse digits of an integer. Example1: x =
123, return 321 Example2: x = -123, return –321 这道题应该不用详细说了。比较简单。唯一的是要注意特殊值0.
public class Solution { publ...
分类:
其他好文 时间:
2014-05-24 01:39:59
阅读次数:
170
1、 创建表完整语法
CREATE TABLE [schema.]table
(column datatype [, column datatype] … )
[TABLESPACE tablespace]
[PCTFREE integer]
[PCTUSED integer]
[INITRANS integer]
[MAXTRANS integer]
[STORAGE sto...
分类:
数据库 时间:
2014-05-22 06:25:53
阅读次数:
384
D. Number theory
Time Limit: 1000ms
Case Time Limit: 1000ms
Memory Limit: 65536KB
64-bit integer IO format: %lld Java class name: Main
Submit Status PID:
34055
Font Size:
+
...
分类:
其他好文 时间:
2014-05-20 16:24:12
阅读次数:
245
integer to String :int i = 42;String str =
Integer.toString(i);orString str = "" + i double to String :String str =
Doubl...
分类:
编程语言 时间:
2014-05-20 12:54:45
阅读次数:
358
题目:给定一个罗马数字串,转换为一个整数。一开始没理解,以为是string to
int。后来理解:罗马数字与阿拉伯数字的映射关系,见下图:至此,题目的意思才掌握明白,用程序模拟这张表。无可置否,需要将这张表的映射关系存进一个map中,对输入的string查找map中的映射关系。先贴上代码:(注:s...
分类:
其他好文 时间:
2014-05-19 21:15:15
阅读次数:
295
WeakHashMap使用弱引用来作为Map的Key,利用虚拟机的垃圾回收机制能自动释放Map中没有被使用的条目。但是WeakHashMap释放条目是有条件的:首先条目的Key在系统中没有强引用指向;另外,条目的释放是在垃圾回收之后第一次访问这个WeakHashMap时完成的。
而当我们想...
分类:
其他好文 时间:
2014-05-19 21:13:21
阅读次数:
314
工具用 SQLite
Dev数据类型:1.NULL:空值。2.INTEGER:带符号的整型,具体取决有存入数字的范围大小。3.REAL:浮点数字,存储为8-byte
IEEE浮点数。4.TEXT:字符串文本。5.BLOB:二进制对象。=======================添加 sqlite-...
分类:
数据库 时间:
2014-05-19 17:09:21
阅读次数:
349
题意:
Evaluate the value of an arithmetic expression in
Reverse Polish Notation.
Valid operators are +, -, *,
/. Each operand may be an integer or another expression.
So...
分类:
其他好文 时间:
2014-05-18 08:09:15
阅读次数:
190
【题目】
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
【题意】
把罗马数转换为整数
【思路】
罗马数字中只使用如下七个基值字母:M,D,C,L,X,V,I,分别用来表示1000、500、100、50、10、5、1。
大体思路是每个罗马字母对应的值相加即可,
但需要处理900, 400, 90, 40, 9, 4这几个特殊...
分类:
其他好文 时间:
2014-05-18 07:58:54
阅读次数:
293
18. 字符串、包装类、原始数据类剪得转换:
各个转换如下:
1>String 转换成Integer:
Integer integer = new Integer(“string”);或
Integer Integer = Integer.valueOf(String);
注:String必须是数字字符串,如:”1232“。
2>Integer 转换成String:...
分类:
编程语言 时间:
2014-05-18 07:40:29
阅读次数:
240