58,454
社区成员
发帖
与我相关
我的任务
分享
public class Test25 {
public static void main(String[] args) {
String s = args[0];
int n = Integer.parseInt(s);
int i = 0;
int[] a = new int[5];
do {
a[i] = n%10;
n /= 10;
++i;
}while(n != 0);
System.out.println("这是一个" + i + "位数,从个位起,各个数字依次为:");
for(int j=0;j<i;j++) {
System.out.println(a[j] + " ");
}
}
}
public class Test25 {
public static void main(String[] args) {
String s = args[0];
int size = s.length;
int n = Integer.parseInt(s);
int i = 0;
int[] a = new int[size];
do {
a[i] = n%10;
n /= 10;
++i;
}while(n != 0);
System.out.println("这是一个" + i + "位数,从个位起,各个数字依次为:");
for(int j=0;j<i;j++) {
System.out.println(a[j] + " ");
}
}
}