Run ID:151987
提交时间:2026-04-19 13:56:02
#include<bits/stdc++.h> using namespace std; int main(){ int n,x; cin>>n; int a[n+3]; for(int i=0; i<n; i++) { cin>>a[i]; } for(int i=0; i<n; i++) { for(int j=i; j>0; j--) { if(a[j]<=a[j-1]) { swap(a[j],a[j-1]); } } if(i!=0){ for(int i=0; i<n; i++) { cout<<a[i]<<" "; } if(i!=n){ cout<<endl; } } } return 0; }