import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner (System.in);
int n = sc.nextInt();
int [] q = new int[n];
for (int i = 0; i < n; i ++)
q[i] = sc.nextInt();
for (int i = 0; i < n; i ++)
for (int j = i + 1; j < n; j ++)
if (q[j] < q[i]){
int t = q[i];
q[i] = q[j];
q[j] = t;
}
for (int i = 0; i< n; i ++)
System.out.printf("%d ", q[i]);
}
}
标签:Scanner,nextInt,int,System,选择,++,sc,排序 From: https://www.cnblogs.com/fghjktgbijn/p/17367034.html2023-05-01 21:28:57 星期一