#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
struct node{
string a,b;
}a[30005],g[30005];
struct nod{
string a,b;
int n;
}c[30005];
bool Cmp(node a,node b){
return a.a<b.a;}
bool fum(nod a,nod b){
return a.n>b.n;}
bool fu(node a,node b){
if(a.b==b.b)
return a.a<b.a;
return a.b<b.b;}
bool fun(nod a,nod b){
if(a.n==b.n)
return a.a<b.a;
return a.n>b.n;}
int main(){
// freopen("1.txt","r",stdin);
int i=0;
string t;
while(cin>>a[i].a){
t=a[i].a;
sort(t.begin(),t.end());
a[i].b=t;
i++;
}
sort(a,a+i,fu);
int d=0;
c[0].a=a[0].a;
c[0].b=a[0].b;
c[0].n=1;
for(int k=1;k<i;k++){
poj2408 字符串处理,排序
最新推荐文章于 2021-01-30 22:36:11 发布
该博客主要探讨了如何处理字符串并进行排序。首先通过读取输入的字符串,将其转化为小写并排序,然后使用自定义排序函数对字符串数组进行排序。接着,将相同字符串归为一组,并按组内元素数量进行再次排序。最后,输出每组中不同字符串及其出现次数。这是一个涉及字符串操作、排序算法和数据分组的问题。

订阅专栏 解锁全文
550





