关于每输出100个,就换行的问题???
import java.util.*;public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int n;
while (cin.hasNext()) {
n = cin.nextInt();
long a[] = new long[n + 1];
for (int i = 1; i <= n; i++) {
a[i] = cin.nextInt();
}
Arrays.sort(a);
for (int j = 1; j <= n; j++) {
System.out.print(a[j] + " ");
if (j % 100 == 0) {
System.out.println();
continue;
} else {
continue;
}
}
System.out.println();
}
}
}
这样不行吗???