#include using namespace std; int main() { int n, a[5000],b,c,cnt1=0,cnt2=0; //中身 cin >> n; for (int z = 0; z < n; z++) { cin >> a[z]; } for (int i = 0; i < 2 * n - 3; i++) //処理 { for (int p = 0; p < n - 1; p++) { for (int q = i - p; q > p; q++) { cnt1++; if (a[p] <= a[q]) break; cnt2++; } } if (cnt1 = cnt2) { for (int x = 0; x < n - 1; x++) { for (int y = i - x; y > x; y++) { a[x] = b, a[y] = c; a[x] = c, a[y] = b; } } } } for (int m = 0; m < n - 1; m++) { cout << a[m]; } cout << a[n - 1] << endl; }