10950
-
[백준 10950][Swift] 두 정수 A와 B를 입력받은 다음, A+B를 출력 -3카테고리 없음 2022. 3. 31. 14:39
코드 let inputT = Int(readLine()!)! for _ in 1...inputT { let inputNum = readLine()?.split(separator: " ") let a = Int(inputNum?.first ?? "0")! let b = Int(inputNum?.last ?? "0")! print(a + b) } 혹은 map 메소드 이용 let inputT = Int(readLine()!)! for _ in 1...inputT { let inputNum = (readLine()?.split(separator: " ").map { Int($0)! })! print(inputNum[0] + inputNum[1]) } https://www.acmicpc.net/problem/10..