由于某种原因,命令提示符不断要求我输入,但我在第 12 行(总和 + 一)= 总和上放置了一个值。如果你们能帮助我确定它有什么问题,那就太棒了。
import java.util.Scanner;
public class FunnyAverage {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.print("How many values to read? ");
int top = in.nextInt();
System.out.print("Enter Value: ");
int one = in.nextInt();
int number = 0;
int sum = 0;
(sum + one) = sum;
while (number>top){
while (one % 6 != 0&&one % 17 != 0) {
System.out.print("Enter Value: ");
one = in.nextInt();
number++;
}
}
if (sum/top != 0){
System.out.print("Average: " + sum/top);
}
System.out.print("None Divisible");
}
}