1181: 谁的年龄最小(结构体专题)
import java.util.*;
import java.io.*;
class friend
{
String name;int x,y,z;
}
public class Main {
static Scanner cin = new Scanner(System.in);static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));public static void main(String[] args) {
friend []a=new friend[11];for(int i=0;i<=10;i++)a[i]=new friend();int n=cin.nextByte();for(int i=0;i<n;i++){
a[i].name=cin.next();a[i].x=cin.nextInt();a[i].y=cin.nextInt();a[i].z=cin.nextInt();}friend ans=a[0];for(int i=1;i<n;i++){
if(ans.x<a[i].x) ans=a[i];if(ans.x==a[i].x&&ans.y<a[i].y) ans=a[i];if(ans.x==a[i].x&&ans.y==a[i].y&&ans.z<a[i].z) ans=a[i];}System.out.printf("%s %d-%02d-%02d", ans.name, ans.x, ans.y, ans.z);out.flush();}
}