문제
https://www.acmicpc.net/status?user_id=tatpo0&problem_id=2460&from_mine=1
package week8.baek;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class B2460 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] on = new int[10];
int count = 0;
for (int i = 0; i < 10; i++) {
String input = br.readLine();
count -= Integer.parseInt(input.split(" ")[0]);
count += Integer.parseInt(input.split(" ")[1]);
on[i] = count;
}
Arrays.sort(on);
System.out.println(on[on.length-1]);
}
}
'‡ CODING TEST STUDY ‡ > º 백준' 카테고리의 다른 글
[백준 | Java Bronze III] (#3460) 이진수 (0) | 2024.06.24 |
---|---|
[백준 | Java Bronze III] (#10988) 팰린드롬인지 확인하기 (0) | 2024.06.24 |
[백준 | Java Bronze VI] (#2609) 최대공약수와 최소공배수 (0) | 2024.06.22 |
[백준 | Java Bronze I] (#2869) 달팽이는 올라가고 싶다 - 미완성 (0) | 2024.06.22 |
[백준 | Java Bronze VI] (#14652) 나는 행복합니다~ (0) | 2024.06.22 |