小唐唐 • 14小时前
using namespace std; int a[100005]; int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n;
cin >> n;
for(int i=0; i<n; i++){
cin >> a[i];
}
sort(a,a+n);
/*
for(int i=0; i<n-1; i++){
int k = i;
for(int j=i+1; j<n; j++){
if(a[j] < a[k]){
k = j;
}
}
if(k != i)
{
temp = a[k];
a[k] = a[i];
a[i] = temp;
}
}
*/
ostringstream oss;
for(int i=0; i<n; i++){
cout << a[i] << "\n";
}
oss.str();
return 0;
}
评论:
请先登录,才能进行评论