Run ID:153306
提交时间:2026-05-14 15:37:53
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; while (n--) { string s; cin >> s; vector<int> v; int now = 0; for (int i = 0; i < s.size(); i++) { if (s[i] != '5') { now = now * 10 + (s[i] - '0'); } else { v.push_back(now); now = 0; } } v.push_back(now); sort(v.begin(), v.end()); bool first = true; for (int x : v) { if (!first) cout << " "; cout << x; first = false; } cout << endl; } return 0; }