文章
5
粉丝
136
获赞
4
访问
41.6k
#include <iostream> #include <algorithm> using namespace std; bool cmp(char a,char b) { if(isdigit(a)==0&&isdigit(b)!=0) return 1; else return 0; }
int main() { string s; cin>>s; sort(s.begin(),s.end(),cmp); cout<<s; return 0; }
登录后发布评论
#include <iostream>
#include <algorithm>
using namespace std;
bool cmp(char a,char b)
{
if(isdigit(a)==0&&isdigit(b)!=0) return 1;
else return 0;
}
int main()
{
string s;
cin>>s;
sort(s.begin(),s.end(),cmp);
cout<<s;
return 0;
}