思路倒是简洁明了,将整数的非符号部分的各位存储到一个数组里面,然后将各位组装起来就成为一个新的整数。当然,溢出,符号都是需要考虑的。...
分类:
其他好文 时间:
2015-01-28 09:43:02
阅读次数:
93
思路是很简洁的,但正负号,空格包括中间和字符串的开始和结尾的字符,字符串溢出,整数表示的最大数和负数能表示的最小数。。。。
编程让人变的更加严谨,目测还有很大的提升空间。...
分类:
其他好文 时间:
2015-01-28 09:42:40
阅读次数:
159
// 定义结构体type TmyRec= record name:string[10]; password:string[10]; end;function RawToBytes(const AValue; const ASize: Integer): TBytes;begin S...
分类:
其他好文 时间:
2015-01-27 21:30:58
阅读次数:
156
原题地址找规律+模拟,真没啥可说的。代码: 1 string intToRoman(int num) { 2 string res; 3 4 while (num >= 1000) { 5 res += "M"; 6 ...
分类:
其他好文 时间:
2015-01-27 20:16:36
阅读次数:
170
int是java提供的8种原始数据类型之一,Java为每个原始类型提供了封装类,Integer是java为int提供的封装类。int 是基本类型,Integer是引用类型。java.lang.Integer是一个类.对它的操作要通过类的方法,int是JAVA缺省的8中基本数据类型之一.不是类的对象....
分类:
编程语言 时间:
2015-01-27 19:56:32
阅读次数:
142
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
题目大意
给你个罗马数字,把它转换成一个int数。输入限定在[1, 3999]。
难度系数:容易
实现
一次性通过,:)
int getVal(c...
分类:
其他好文 时间:
2015-01-27 18:22:38
阅读次数:
160
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The...
分类:
其他好文 时间:
2015-01-27 14:57:01
阅读次数:
149
morphia中查询时,使用关键字 in 的条件 ? 定义一个数字或者list Datastore ds = super.getDs(); Query<Province> query = ds.createQuery(Province.class); List<Integer> idList = new ArrayList<Integer>(); i...
分类:
其他好文 时间:
2015-01-27 13:37:56
阅读次数:
243
数据库:CREATE TABLE T_EXTERIOR ( "ID" INTEGER NOT NULL , "EXTERIOR" BLOB(1048576) LOGGED NOT COMPACT NOT NULL ) 序列化并保存到数据库(A项目): Exteri...
分类:
其他好文 时间:
2015-01-27 13:16:28
阅读次数:
135
Determine whether an integer is a palindrome. Do this without extra space.
题目大意
判断一个int是否为回文数,不使用额外的储存空间。
难度系数:容易
实现
int getfactor(int x) {
if (x < 10)
return 1;
int facto...
分类:
其他好文 时间:
2015-01-27 11:13:47
阅读次数:
192