提交时间:2024-08-19 22:49:57

运行 ID: 168123

#include<iostream> #include<cstring> using namespace std; int main(){ int n,a[100001],i,j,b; cin>>n; for(i=1;i<=n;i++){ cin>>a[i]; } for(i=1;i<n;i++){ for(j=i+1;j<=n;j++){ if(a[i]>a[j]){ b=a[i]; a[i]=a[j]; a[j]=b; } } } for(i=1;i<=n;i++){ cout<<a[i]<<" "; } }