Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46747 zhouhuanyu 玙静 字母组合 C++ 通过 0 MS 260 KB 408 2024-05-05 10:59:07

Tests(1/1):


#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; }


测评信息: