Bibi's DevLog π€π
[λ°±μ€ 2953] λλ μ리μ¬λ€ (Swift) λ³Έλ¬Έ
νλ‘κ·Έλλ°/μκ³ λ¦¬μ¦ νμ΄ Swift
[λ°±μ€ 2953] λλ μ리μ¬λ€ (Swift)
λΉλΉ bibi 2022. 9. 29. 12:08https://www.acmicpc.net/problem/2953
κ° μ€μ μ£Όμ΄μ§μ«μλ₯Ό ν©νκ³ , κ°μ₯ ν° μ μμ κ·Έ μ μμ λ²νΈλ₯Ό μΆλ ₯νλ€.
νμ΄
var num = 0
var score = 0
(1...5).forEach { number in
let inputSum = readLine()!.split(separator: " ").map { Int($0)! }.reduce(0, +)
if inputSum > score {
score = inputSum
num = number
}
}
print(num, score)
'νλ‘κ·Έλλ° > μκ³ λ¦¬μ¦ νμ΄ Swift' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[λ°±μ€ 3004] 체μ€ν μ‘°κ° (3) | 2022.09.30 |
---|---|
[λ°±μ€ 2966] μ°κΈ° (Swift) (0) | 2022.09.29 |
[λ°±μ€ 2947] λ무 μ‘°κ° (0) | 2022.09.28 |
[λ°±μ€ 2846] μ€λ₯΄λ§κΈΈ (Swift) (0) | 2022.09.23 |
[λ°±μ€ 2822] μ μ κ³μ° (Swift) (0) | 2022.09.22 |