티스토리 뷰
var a: Int = Int(readLine()!)!
var b: Int = Int(readLine()!)!
var c: Int = Int(readLine()!)!
let result = a * b * c
var count: [Int] = Array.init(repeating: 0, count: 10)
let resultAsString = String(result)
resultAsString.forEach{ i in
let j = Int(String(i))
for k in 0...9{
if j == k{
count[k] += 1
}
}
}
count.forEach{
print($0)
}
'Algorithm > noj.am' 카테고리의 다른 글
[Python] 백준 2440번 - 별찍기 3 (0) | 2020.12.21 |
---|---|
[Python] 백준 1629번 : 곱셈 (0) | 2020.12.21 |
[Swift] 백준 10950 (2) | 2019.11.08 |
[Swift] 백준 11720 (0) | 2019.11.08 |
[Swift] 백준 10817 (0) | 2019.11.08 |