首页 > 其他分享 >回文数

回文数

时间:2023-03-13 12:35:52浏览次数:34  
标签:10 int start behind th 回文 before

 1 import java.util.*;
 2 
 3 public class Main {
 4     public static void main(String args[]) {
 5         int o,t,th,f,before,behind=0;
 6         for (int start = 1000; start < 10000; start++) {
 7                 o = start%10;
 8                 t = (start/10)%10;
 9                 th = (start/100)%10;
10                 f = (start/1000)%10;
11                 before = 10*f+th;
12                 behind = 10*o+t;
13             if (before==behind) {
14                 System.out.println(start);
15             }
16         }
17     }
18 }

 

标签:10,int,start,behind,th,回文,before
From: https://www.cnblogs.com/Fangithub/p/17210920.html

相关文章