王水木公


私信TA

用户名:wsbuzhidao

访问量:562

签 名:

等  级
排  名 5300
经  验 1562
参赛次数 7
文章发表 1
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

解题思路:

注意事项:

参考代码:

#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
string sfz[100010];
bool cmp(string x,string y)
{
    string x1,y1;
    x1=x.substr(6,8);
    y1=y.substr(6,8);
//    cout<<x1<<endl<<y1<<endl;
    if(x1!=y1)
    {
        return x1>y1;
    }
    else
    {
        return x>y;
    }
}
int main()
{
    int n,i;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>sfz[i];
        
    }
    sort(sfz+1,sfz+n+1,cmp);
    for(i=1;i<=n;i++)
    {
        printf("%s\n",sfz[i].c_str());
    }
    return 0;
}


 

0.0分

7 人评分

  评论区

nbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbnbnbnbnbnbnbnbnbnnbnbnbnbnbnbn
2022-07-29 15:46:50
真不错
2022-07-29 15:46:18
nbnbnbnbnbnbnbnb
2022-07-29 15:44:38
  • «
  • 1
  • »