Algorithm/Baekjoon Online Judge

11720번 '숫자의 합'

할루루 2018. 2. 23. 10:00
1
2
3
4
5
6
7
let input1 = Int(readLine()!)!
let input2 = readLine()!
var count = 0
for i in 0..<input1{
    count += Int(input2[input2.index(input2.startIndex, offsetBy: i)].description)!
}
print(count)
Colored by Color Scripter
cs


저작자표시 (새창열림)