Run ID:151312
提交时间:2026-04-11 16:59:29
#include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ vector<long long> res; sting tmp; for(char c:s){ if(c=='5'){ if(!tmp.empty()){ res.push_back(stoll(tmp)); tmp.clear(); } } else{ tmp+=c; } } if(!tmp.empty()){ res.push_back(stoll(tmp)); } sort(res.begin(),res.end()); for(int i=0;i<res.size();++i){ if(i>0) cout<<' '; cout<<res[i]; } cout<<endl; } return 0; }