Bibi's DevLog ๐ค๐
[๋ฐฑ์ค 2562] ์ต๋๊ฐ (Swift) ๋ณธ๋ฌธ
ํ๋ก๊ทธ๋๋ฐ/์๊ณ ๋ฆฌ์ฆ ํ์ด Swift
[๋ฐฑ์ค 2562] ์ต๋๊ฐ (Swift)
๋น๋น bibi 2022. 9. 14. 15:10https://www.acmicpc.net/problem/2562
var maxNum = 0
var maxIndex = 0
(1...9).forEach { index in
let input = Int(readLine()!)!
if input > maxNum {
maxNum = input
maxIndex = index
}
}
print(maxNum, maxIndex, separator: "\n")
'ํ๋ก๊ทธ๋๋ฐ > ์๊ณ ๋ฆฌ์ฆ ํ์ด Swift' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค 25024] ์๊ฐ๊ณผ ๋ ์ง (Swift) (0) | 2022.09.17 |
---|---|
[๋ฐฑ์ค 2566] ์ต๋๊ฐ (Swift) (0) | 2022.09.15 |
[๋ฐฑ์ค 2490] ์ท๋์ด (1) | 2022.09.13 |
[๋ฐฑ์ค 2484] ์ฃผ์ฌ์ ๋ค๊ฐ (Swift) (0) | 2022.09.12 |
[๋ฐฑ์ค 2476] ์ฃผ์ฌ์ ๊ฒ์ (Swift) (0) | 2022.09.09 |