其他分享
首页 > 其他分享> > Another Sorting Problem

Another Sorting Problem

作者:互联网

#include<bits/stdc++.h>
using namespace std;
struct stu{
    string s;
    int num;
}a[1000005];
int cmp(stu a,stu b){
    return a.s<b.s; 
}
int main(){
    int n,m;
    scanf("%d %d",&n,&m);
    for(int i=1;i<=n;i++){
        cin>>a[i].s;
        a[i].num=i;
        for(int j=1;j<m;j+=2){
            a[i].s[j] = 'Z' - a[i].s[j] + 'A';
        }
    }
    sort(a+1,a+1+n,cmp);
    for(int i=1;i<=n;i++){
        cout<<a[i].num<<" ";
    }
    return 0;
} 

 

标签:std,Sorting,return,int,stu,num,Another,Problem
来源: https://www.cnblogs.com/happycrazy/p/15857048.html