package day2;
import java.util.Scanner;
public class D打印逆序数字 {
private static int fun(int n){
int a[] = new int[20];
int i = 0;
while(n!=0){
a[i++] = n%10;
n = n/10;
}
for(int j=0;j<i;j++){
System.out.print(a[j]);
}
return 0;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
fun(n);
}
}
算法基础-打印逆序数字
最新推荐文章于 2023-11-09 10:15:10 发布