HashMap的使用:
java.util.HashMap<Integer,Integer> map =
new
java.util.HashMap<Integer,Integer>();
map.put(int,int);
map.get(int,int);
最大公约数
public
static
int
gcd(
int
m,
int
n) {
return
n ==
0
? m : gcd(n, m % n);
}
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int n = sc.nextInt();
int a = sc.nextInt();
}
while(sc.hasNext()){
int n = sc.nextInt();
int a = sc.nextInt();
}