From 7d3a8a3ec9a0ae86ecc4939809dc260c58163a2d Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Wed, 4 Mar 2026 18:39:42 +0900 Subject: [PATCH] baekjoon 20260304 --- code_study/Baekjoon/swift/2460.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 code_study/Baekjoon/swift/2460.swift diff --git a/code_study/Baekjoon/swift/2460.swift b/code_study/Baekjoon/swift/2460.swift new file mode 100644 index 0000000..0d087e7 --- /dev/null +++ b/code_study/Baekjoon/swift/2460.swift @@ -0,0 +1,14 @@ +var ans: Int = 0 +var cur: Int = 0 + +for _ in 0...9 { + guard let info = readLine() else { break } + + let io = info.split(separator : " ").compactMap{Int($0)} + guard io.count == 2 else { break } + + cur += io[1] - io[0] + ans = max(ans, cur) +} + +print(ans) \ No newline at end of file