728x90
๋ฐ์ํ
Problem
Solution
1. ์ซ์๋ฅผ ์ ๋ ฅ ๋ฐ์ผ๋ฉฐ ์ต๋๊ฐ์ ๊ฐฑ์ ํ๋ค.
var count:Int = 0
var max = (0,0)
while count < 9 {
let n = Int(readLine() ?? "") ?? 0
count += 1
if max.1 < n {
max = (count,n)
}
}
2. ์ต๋๊ฐ๊ณผ ์ต๋๊ฐ์ด ๋ช ๋ฒ์งธ์ธ์ง ์ถ๋ ฅํ๋ค.
print(max.1)
print(max.0)
Source Code
728x90
๋ฐ์ํ
'๐ Problem Solution' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Swift] Baekjoon 12919๋ฒ A์ B 2 (0) | 2022.01.07 |
---|---|
[Swift] Baekjoon ํฐ๋ฆฐ๋๋กฌ ๋ง๋ค๊ธฐ 1254๋ฒ (0) | 2022.01.06 |
[Swift] Baekjoon ํฐ ์ A + B 10757๋ฒ (0) | 2022.01.06 |
[Swift] 2020 KAKAO BLIND RECRUITMENT ์ธ๋ฒฝ ์ ๊ฒ (0) | 2021.09.08 |
[Swift] 2018 KAKAO BLIND RECRUITMENT [1์ฐจ] ์ถ์ ํธ๋ํฝ (0) | 2021.05.19 |
๋๊ธ