Scanner sc = new Scanner(System.in);
int d,y = 0;
int x = sc.nextInt();
while (x != 0){
d = x % 10;
y = y * 10 + d;
x = x / 10;
}
System.out.println(y);
经典程序设计
Scanner sc = new Scanner(System.in);
int d,y = 0;
int x = sc.nextInt();
while (x != 0){
d = x % 10;
y = y * 10 + d;
x = x / 10;
}
System.out.println(y);
经典程序设计
本文标题:输入一个数,将这个数倒叙输出
本文链接:https://www.haomeiwen.com/subject/gimauttx.html
网友评论