C++ 代码
#include <bits/stdc++.h>
using namespace std;
int t, n;
int main() {
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n;
string a;
cin >> a;
// 如果需要确保所有字符都是小写,可以添加如下代码:
// for (char &c : a) {
// c = tolower(c);
// }
sort(a.begin(), a.end()); // 直接对字符串进行排序 ,
cout << a << endl; // 输出排序后的字符串
}
return 0;
}