方法1
import java.util.Scanner;class PTA34 {public static void main (String [] args) {Scanner sc = new Scanner(System.in);String s = sc.nextLine();int n=Integer.parseInt(s);addressbook[] aa=new addressbook[n];for (int i = 0; i < n; i++) {String addressline = sc.nextLine();String[] s1 = addressline.split(" ");aa[i]=new addressbook(s1[0],s1[1],s1[2],s1[3],s1[4]);}int num = sc.nextInt();int index=0;for (int i = 0; i < num; i++) {index=sc.nextInt();if (index< n) {System.out.println(aa[index].echostring());}else{System.out.println("Not Found");}}}static class addressbook{private String name;private String birth;private String sex;private String telphone;private String mible;public String echostring(){return name + " " + telphone + " " + mible + " " + sex + " " + birth;}public addressbook(String name, String birth, String sex, String telphone, String mible) {this.name = name;this.birth = birth;this.sex = sex;this.telphone = telphone;this.mible = mible;}}}