#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
typedef struct{
string name;
string bir;
}people;
bool cmp(people s)
{
string sx="2014/09/06";
string xx="1814/09/06";
if(s.bir>=xx && s.bir<=sx)
return true;
return false;
}
struct rule1{
bool operator()(const people &p1,const people &p2) const{
return p1.bir<p2.bir;
}
};
int main()
{
int n;
cin>>n;
vector<people> v;
people old,young;
for(int i=0;i<n;i++)
{
people x;
cin>>x.name>>x.bir;
if(cmp(x))
v.push_back(x);
}
if(v.size()!=0)
{
cout<<v.size()<<" ";
sort(v.begin(),v.end(),rule1());
cout<<v.begin()->name<<" "<<(v.end()-1)->name;
}
else
cout<<v.size();
return 0;
}
04-19
06-06
06-06
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交