![AC](http://img.e-com-net.com/image/info8/8d033ca9df4a42c487a222532915fb41.jpg)
PAT乙级真题答案目录
#include
#include
int main() {
int N;
scanf("%d", &N);
char name[6], minName[6], maxName[6];
int year, month, day, cnt = 0;
int maxBDay = 20140907, minBDay = 18140905;
for(int i = 0; i < N; i++) {
scanf("%s %d/%d/%d", name, &year, &month, &day);
int age = year*10000 + month*100 + day;
if(age < 20140907 && age > 18140905) {
cnt++;
if(age < maxBDay) {
maxBDay = age;
strcpy(maxName, name);
}
if(age > minBDay) {
minBDay = age;
strcpy(minName, name);
}
}
}
printf("%d", cnt);
if(cnt != 0)
printf(" %s %s", maxName, minName);
return 0;
}