习题一:
Given:
class Alligator {
public static void main(String[] args) {
int []x[] = {{1,2}, {3,4,5}, {6,7,8,9}};
int [][]y = x;
System.out.println(y[2][1]);
}
}
What is the result?
A. 2
B. 3
C. 4
D. 6
E. 7
F. Compilation fails
习题二:
Given:
有一对兔子,从出生后第3个月起每个月都生一对兔子小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少?
Please finish in Java Code and it can be run without exception.
Example:
output:第 24 个月后兔子数量为:XX
习题三:
Given:
打印出杨辉三角形
Please finish in Java Code and it can be run without exception.
Example:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1