有人請解釋下面的嵌套循環內發生了什麼。我無法理解它是如何工作的。有人可以向我解釋這個嵌套循環內發生了什麼?
int numberOfTimesheets;
int centsPerHour = 0;
int hoursWorked;
total = 0;
numberOfTimesheets = stdin.nextInt();
for(int i = 1; i <= numberOfTimesheets; i++){
hoursWorked = 0;
centsPerHour = stdin.nextInt();
for (int ii = 1; ii <= 5; ii++){
hoursWorked = hoursWorked + stdin.nextInt();
}
total = total + (hoursWorked * centsPerHour);
}
究竟它不明白嗎?變量的名稱應該是一個巨大的線索。 – chrylis