码迷,mamicode.com
首页 >  
搜索关键字:integer    ( 14932个结果)
java对象Integer不能引用传递
java对象Integer不能引用传递 /** * The value of the Integer. * * @serial */ private final int value; /** * Constructs a ne...
分类:编程语言   时间:2014-11-06 10:44:59    阅读次数:168
poj1811 Prime Test,随机素数测试
Prime Test Time Limit: 6000MS   Memory Limit: 65536K Total Submissions: 24514   Accepted: 5730 Case Time Limit: 4000MS Description Given a big integer number, you are ...
分类:其他好文   时间:2014-11-05 23:13:24    阅读次数:237
LeetCode:Palindrome Number
题目描述: Determine whether an integer is a palindrome. Do this without extra space. 代码: bool Solution::isPalindrome(int x) { int a = x; int b = 0; while(a > 0) { b = b * ...
分类:其他好文   时间:2014-11-05 21:35:26    阅读次数:167
String to Integer (atoi)
Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ...
分类:其他好文   时间:2014-11-05 19:12:08    阅读次数:176
实现一个整数类
注意点:前++和后++的区别。>>操作符注意处理输入失败的情形代码: 1 #ifndef INTEGER_H_ 2 #define INTEGER_H_ 3 4 #include 5 6 class Integer 7 { 8 9 friend std::ostream &opera...
分类:其他好文   时间:2014-11-05 16:52:41    阅读次数:181
LeetCode: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 possib...
分类:其他好文   时间:2014-11-05 13:09:01    阅读次数:172
【转】c/c++各种字符、字符串类型转换
itoa 功 能:把一整数转换为字符串 用 法:char *itoa(int value, char *string, int radix); 详细解释:itoa是英文integer to array(将int整型数转化为一个字符串,并将值保存在数组string中)的缩写. 参数: val...
分类:编程语言   时间:2014-11-05 12:17:15    阅读次数:209
Integer是不可变类,进入一个方法后,在里面的值的改变不会影响方法外的引用
先看一个小程序 主函数的输出并没有像想像中一样会输出3,而是输出初始化的数值0 这是因为与String类似,所有的包装类都是final类,即不可变类。虽然在代码A处看起来是改变了counter的值,但实际上是创建了另一个对象,并将方法内的counter参数的引用指向了这个新创建的对象,由于是不同的引用,所以不会对方法外的引用有任何的影响。内存图如下所示: 在刚...
分类:其他好文   时间:2014-11-05 09:20:28    阅读次数:209
[ACM] SDUT 2886 Weighted Median (省赛最悲剧的一道题)
Weighted Median Time Limit: 2000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 For n elements x1,?x2,?...,?xn with positive integer weights w1,?w2,?...,?wn. The weighted median is the...
分类:其他好文   时间:2014-11-04 22:51:14    阅读次数:290
常用的正则表达式
在项目中个人写的一个常用验证的正则表达式:(仅供参考)//定义两个全局变量var reg;var errorInfo;//输入的数字类型必须是int型,正负整数都可以function validate_integer(text,value){ reg=/^[-\+]?\d+$/; errorInfo...
分类:其他好文   时间:2014-11-04 19:16:42    阅读次数:346
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!