Run ID:129454

提交时间:2025-08-25 17:01:57

#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for(int i = 0; i < n; i++) { cin >> a[i]; } int t; for(int i = 0; i < n - 1; i++) { for(int j = i + 1; j < n; j++) { if(a[i] > a[j]) { t = a[i]; a[i] = a[j]; a[j] = t; } } } for(int i = 0; i < n; i++) { cout << a[i] << " "; } return 0; }