import java.util.Scanner; public class Main { public static int reverse(int n) { int res=0; while(n>0) { res=res*10+n%10; n=n/10; } return res; } public static void main(String[] args) { Scanner cin = new Scanner(System.in); int n=cin.nextInt(); while(true) { int m=reverse(n); if(m==n) { System.out.printf("%d ",n); break; } else { System.out.printf("%d ",n); n+=m; } } } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)