public class Sort {
public Sort() {
// TODO Auto-generated constructor stub
}
public void maoPao(int[] a) {
int temp = 0;
for (int i = a.length - 1; i > 0; --i) {
for (int j = 0; j < i; ++j) {
if (a[j + 1] < a[j]) {
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}
}
}
public static void main(String[] args) {
int[] x = { 5, 9, 4, 2, 3, 10, 18, 12, 11, 7 };
Sort s = new Sort();
s.maoPao(x);
for (int i = 0; i < x.length; i++) {
System.out.print(x[i] + " ");
}
}
}
请说明所用语种。
JAVA?