Run ID:85086

提交时间:2024-07-16 16:21:47

#include<bits/stdc++.h> using namespace std; int main() { int a[5]={8,3,4,9,7}; int t,j; for(int i=1; i<5; i++) { t = a[i]; for(j=i; j>0; j--) { if(t<a[j-1]) { a[j] = a[j-1]; } else { break; } } a[j]=t; } for(int i=0;i<5;i++){ cout << a[i] << ' ' ; } return 0; }