您的位置:首页 > 其它

Coderforces Tram

2017-06-13 10:37 288 查看
http://codeforces.com/problemset/problem/116/A

import java.util.Scanner;

public class Tram {

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int max = 0;
int temp = 0;
for(int i = 0; i <n; i++) {
int a = scanner.nextInt();
int b= scanner.nextInt();
//车内容量
temp += b - a ;
if(max < temp) max = temp;
}
System.out.println(max);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: