Run ID:4399
提交时间:2024-08-17 17:11:08
# include<iostream> using namespace std; int main() { int l,n = 0; cin>>n; int lst[1000]={}; for(int i = 0; i < n; i++) { cin>>lst[i]; } for(int a = 0; a < n - 1; a++) { for(int b = 1; b < n; b++) { if(lst[b]>lst[b-1]) { l = lst[b]; lst[b] = lst[b-1]; lst[b-1] = l; } } } for(int i = 0; i < n; i++) { cout<<lst[i]<<" "; } return 0; }