展开全部
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
public class MyCount {
public static void main(String[] args) {
e69da5e887aa3231313335323631343130323136353331333431373262Integer[] arr={1,2,2,2,2,4,4,4,6,6,6,6,12,12,13,13,13,16,17,19,19,19,36,39};
List numList=Arrays.asList(arr);
TreeSet ts=new TreeSet<>(numList);
Iterator it=ts.iterator();
for (int i=0;it.hasNext();) {
int index=++i,num=it.next(),count=0;
System.out.println("工序"+index+":"+num);
for(int j=0;j
if(numList.get(j)==num) {
System.out.println("\t次数:"+(++count)+":"+num);
}
}
}
}
}