import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
//题意不明,不就是把每一天的历史数量加一起吗
Scanner scanner = new Scanner(System.in);
final int nextLineNum = Integer.parseInt(scanner.nextLine());
ArrayList<Integer> record = new ArrayList<>();
int toDayHours = hours(scanner.nextLine());
record.add(toDayHours);
for (int count = 1; count < nextLineNum; count++) {
// int yesterdayHour = toDayHours;//难道我这样写?
toDayHours = toDayHours/*这是前天,试了试用代码太难表达清楚了导致这里变量名还是今天*/ + hours(scanner.nextLine());
record.add(toDayHours);
}
System.out.println(record.stream().mapToInt(Integer::intValue).sum());
}
static int hours(String line) {
String[] two = line.split(" ");
return Integer.parseInt(two[0]) + Integer.parseInt(two[1]) - 8;
}
}
入门题都这么难吗?很简单但很难啊