我的代码不起作用
public static int[] powersOfTwoArray(int n) {
int[] result = new int[n];
int i = 0;
int power = 0;
while (i <= n) {
result[i] = power;
power *= 2;
}
return result;
}
该方法应返回一个包含 2 从 2 raise 到 0 的幂的数组。
jeck猫
互换的青春
FFIVE
随时随地看视频慕课网APP
相关分类