import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main{ public static void main(String[]args) { ArrayList<Integer> list=new ArrayList<>(); Scanner input=new Scanner(System.in); int []a=new int[10]; for(int i=0;i<10;i++) { a[i]= input.nextInt(); } int count=0; for(int i=0;i<10;i++) { if(a[i]!=0) { count=a[i]; for(int j=count;j>0;j--) { list.add(i); } } } for(int i:list) { System.out.print(i); } } }
标签:java,Scanner,int,个数,最小,PTA,util,import,new From: https://www.cnblogs.com/liliczw2209/p/17446839.html