某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。
这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过 200 岁的老人,假设今天是 2014 年 9 月 6 日,那么超过 200 岁的生日和未出生的生日都是不合理的,应该被过滤掉。
A town conducted a census and got the birthdays of all its residents. Now, please write a program to find the oldest and youngest people in town.
Here it is ensured that each date entered is legal, but not necessarily reasonable - assuming it is known that no one in town is over 200 years old, and assuming that today is September 6, 2014, then birthdays over 200 and unborn birthdays are both unreasonable and should be filtered out.