C++ 字符排序:按ASCII码升序输出三个字符
#include
int main() { int N; cin >> N; while (N--) { string str; cin >> str; sort(str.begin(), str.end()); for (int i = 0; i < str.length(); i++) { cout << str[i] << ' '; } cout << endl; } return 0; }
原文地址: https://www.cveoy.top/t/topic/i7NU 著作权归作者所有。请勿转载和采集!