基础练习 特殊回文数
来源:互联网 发布:影驰gtx960大将优化 编辑:程序博客网 时间:2024/05/16 06:17
- import java.util.Scanner;
- class Main{
- public static void main(String[] args) {
- Scanner input=new Scanner(System.in);
- int n=input.nextInt();
- for(int i=10000; i<1000000; i++){
- boolean b = huiwen(i);
- int s =0;
- if(b){
- String numm1 = i+"";
- char[] c =numm1.toCharArray();
- int end = (numm1).length();
- for(int j=0; j<end; j++){
- s = s + (c[j]-48);
- }
- if(n==s){
- System.out.println(i);
- }
- }
- }
- }
- public static boolean huiwen(int numm){
- String numm1 = numm+"";
- int first = 0;
- int end = (numm1).length();
- int[] arr = new int[end];
- for(; first<end; ){
- if(numm1.charAt(first) != numm1.charAt(end-1)){
- return false;
- }
- first++;
- end--;
- }
- return true;
- }
- }
0 0
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- 基础练习 特殊回文数
- Quartz使用示例总结(转载)
- linker command failed with exit code 1 (use -v to see invocation) 错误分析以及解决方案
- 非阻塞socket引发的数据不完整
- 数据结构的简单学习1
- IOS学习之Tab Bar的使用和视图切换
- 基础练习 特殊回文数
- 邪恶的浏览器DNS缓存
- ios学习笔记1
- 假如世界欺骗了你
- 完善bash历史命令审核
- (转)Android截图代码实现(DDMS的ddmlib.jar)
- MFC框架原理以及消息运行机制1
- Using command redirection operators in Windows
- 在ListView的Item中使用RadioButton实现单选