Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46747 | zhouhuanyu 玙静 | 字母组合 | C++ | Accepted | 0 MS | 260 KB | 408 | 2024-05-05 10:59:07 |
#include <bits/stdc++.h> using namespace std; char a[10001]; void bubble_sort(char a[], int n){ for(int i = 1; i < n; i++){ for(int j = 1; j <= n - i; j++){ if(a[j] > a[j + 1]){ swap(a[j], a[j + 1]); } } } } int main(){ int n; cin >> n; for(int i = 1; i <= n; i++){ cin >> a[i]; } bubble_sort(a, n); for(int i = 1; i <= n; i++){ cout << a[i]; } return 0; }