public static void main(String[] args) throws Exception {
String name,name1;
String ph="" ;
Scanner scan = new Scanner(System.in);
map<String, String> map = new Hashmap<String, String>();
while(!ph.equals("0000")){
System.out.println("输入姓名和电话号码: (当输入的号码为0000时结束)");
name = scan.nextLine();
ph = scan.nextLine();
map.put(name, ph);
}
System.out.println("输入你想查询的的名字:");
|
|