java
文章平均质量分 63
EvenTiger
这个作者很懒,什么都没留下…
展开
-
整型反转 如-123反转成-321
public class StringRevers { /** *int 类型反转 *test:1 1 *test:-1 -1 *test:123 321 *test:-123 -321 *test:-123456789 -987654321 *test:123456789 987654321 */ public static void main(String原创 2013-06-13 14:18:02 · 1790 阅读 · 0 评论 -
挑战题:字符串转换成整数 “456”转换456
今天看了别人的文章才发现自己没有考虑溢出问题,很遗憾地错过了这到题,但自己复习了好多以前的知识。 下面是自己的源码: public class getnumbers { public int getNumber(String str){ int len=0; int i=0; if(str==""){ return 0; } str=str.trim(); if(原创 2013-06-06 17:03:56 · 653 阅读 · 0 评论