import java.util.HashMap;
import java.util.Scanner;
class FootBall
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
HashMap<Integer,String> hm = new HashMap<Integer,String>();
hm.put(1938,"乌拉圭");
hm.put(1942,"意大利");
hm.put(1946,"意大利");
hm.put(1950,"乌拉圭");
hm.put(1954,"德国");
hm.put(1958,"巴西");
hm.put(1962,"巴西");
hm.put(1966,"英格兰");
hm.put(1970,"巴西");
hm.put(1974,"德国");
hm.put(1978,"阿根廷");
hm.put(1982,"意大利");
hm.put(1986,"阿根廷");
hm.put(1990,"德国");
hm.put(1994,"巴西");
hm.put(1998,"法国");
hm.put(2002,"巴西");
hm.put(2006,"意大利");
hm.put(2010,"西班牙");
hm.put(2014,"德国");
System.out.println("请输入想要查询的年份");
int a = sc.nextInt();
Set<Integer> s = hm.keySet();
for(Integer it : s){
String st = hm.get(it);
if(a==it){
System.out.println(st);
}
}
}
}
|
|