import java.util.ArrayList;
public class RanTool {
public static int[] rNumber(ArrayList<Integer> list){
int[] s = new int[list.size()];
for (int i = 0; i < list.size(); i++) {
s[i]=list.get(i);
}
for (int i = 0; i < s.length; i++) {
for (int j = 0; j < s.length -1- i; j++) {
if (s[j] > s[j + 1]) {
int t;
t = s[j];
s[j] = s[j + 1];
s[j +1 ] = t;
}
}
}
return s;
}
}
|
|