我试图从用户输入中捕捉最低的双倍。我只捕获初始化的 min 变量的值 - 我错过了什么?谢谢!
public static void main(String[] args) {
double[] lowNum = new double[10];
Scanner input = new Scanner(System.in);
for (int i=0; i<=9; i++) {
System.out.println("Enter a double: ");
lowNum[i] = input.nextDouble();
}
input.close();
double min = calcLowNum(lowNum);
System.out.println(min);
}
public static double calcLowNum(double[] a) {
double min=0;
for (int i=0; i>=9; i++){
for (int j=0; j>=9; j++){
if (a[i]<=a[j] && j==9){
min=a[i];
}
else {
continue;
}
}
}
return min;