let input = readLine()!.split(separator: " ").map { Int($0)! * Int($0)! }.reduce(0, +)
print(input % 10)
์ซ์๋ค์ ํฉ์ ๋ํ ๋๋ .reduce(0, +)๋ฅผ ์ฐ๋ฉด ํธํ๋ค.
๋ฐ์ํ
'๐ ์ฝํ > BOJ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Swift] ๋ฐฑ์ค1436 (0) | 2023.03.23 |
---|---|
[Swift] ๋ฐฑ์ค1181 (0) | 2023.03.23 |
[Swift] ๋ฐฑ์ค1259 (0) | 2023.03.23 |
[Swift] ๋ฐฑ์ค 1085 ์ง์ฌ๊ฐํ์์ ํ์ถ (0) | 2023.03.22 |
[Swift] ๋ฐฑ์ค1018 (0) | 2023.03.22 |