String str = "897986";
int array[] = new int[str.length];
for(int i-0;i
}
//高闹大致实现如以上代码,由于是直接在回答页面敲的,可能方法名之销并类的会敲错,你有编辑工具的话,用提示功能查找下是不是对的,有问题追亏念迹问
import java.util.Scanner;
public class test{
public static void main(String[] args) {
int num,count=0,countA;
int [] temp = new int[10];
int [] array = new int [10];
System.out.print("请输入一个整神码大数:模物"游竖);
num = new Scanner(System.in).nextInt();
while (num!=0) {
count++;
temp[count]=num%10;
num/=10;
}
countA = count;
for (int i = 0; i < count; i++) {
array[i]=temp[countA];
countA--;
}
for (int i = 0; i < count; i++) {
if (i==count-1) {
System.out.print(array[i]);
}else{
System.out.print(array[i]+",");
}
}
}
}