题解
2023-07-29 16:28:22
发布于:安徽
9阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
string s[55];
string m[14]={"3","4","5","6","7","8","9","10","J","Q","K","A","2","Joker"};
bool cmp(string a,string b)
{
int am,bm;
for(int i=0;i<14;i++)
{
if(m[i]==a) am=i;
if(m[i]==b) bm=i;
}
return am<bm;
}
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)
cin>>s[i];
sort(s,s+n,cmp);
for(int i=0;i<n;i++)
cout<<s[i]<<endl;
return 0;
}
这里空空如也
有帮助,赞一个