public class whatever {
public static void main(String[] arguments){
int points = 0;
int target = 100;
tagetLoop:
while (target <= 100) {
for (int i = 0; i < target; i++) {
if (points > 50)
break tagetLoop;
points = points + i;
System.out.println("Points: " + points);
}
}
}
}
每当我运行它时,最终输出将是“Points: 55”。为什么是55而不是50?