提交时间:2023-01-13 20:15:19

运行 ID: 4999

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