leetcodeo7---reverse
来源:互联网 发布:mac os stm8 编辑:程序博客网 时间:2024/06/05 22:41
public static int reverse(int x){
char [] numArry=null;
String numStr="";
if(x==0){
return x;
}
else if(x>0){
numArry=(x+"").toCharArray();
}
else{
numStr+="-";
for(int i=numArry.length-1;i>=0;i--){
numStr+=numArry[i];
}
return Integer.valueOf(numStr);
}
}
char [] numArry=null;
String numStr="";
if(x==0){
return x;
}
else if(x>0){
numArry=(x+"").toCharArray();
}
else{
numStr+="-";
numArry=(x+"").substring(1).toCharArray();
}for(int i=numArry.length-1;i>=0;i--){
numStr+=numArry[i];
}
return Integer.valueOf(numStr);
}
}
0 0
- leetcodeo7---reverse
- reverse
- reverse
- Reverse
- reverse()
- 【reverse】
- reverse
- reverse
- reverse()
- reverse
- Reverse Ajax
- Reverse string
- reverse()翻转
- Reverse engineering
- Reverse Text
- Poisoned Reverse
- reverse mapping
- Reverse byte
- 死锁例子
- 约瑟夫问题java实现
- git-ssh 配置和使用
- 《深入理解Java虚拟机——JVM高级特性与最佳实践》学习笔记——线程安全与锁优化
- poj2001(Trie树)
- leetcodeo7---reverse
- JavaScript基础(二)
- Linux--僵尸进程与孤儿进程总结
- DAO模式的组成
- iOS文件下载
- 编程实现字符串中子串的查找
- PrintStream 类
- 存在 汪峰
- 同一台服务器运行多个mysql实例