[BaekJoon] A+B - 5
2024. 10. 6. 13:30
문제
https://www.acmicpc.net/problem/10952
import Foundation
var arr: [Int] = []
while true{
let line = readLine()!
let lineArr = line.components(separatedBy: " ")
let a = Int(lineArr[0])!
let b = Int(lineArr[1])!
if a==0 && b==0{
for i in 0..<arr.count{
print(arr[i])
}
break
}else {
arr.append(a+b)
}
}
출처
[Swift] 백준 10952번 문제 A+B - 5
https://www.acmicpc.net/problem/10952 10952번: A+B - 5 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. www.acmicpc.net https://github.com/Ljunhyeob/baekjoon10952 GitHub - Ljunhyeob/baekjoon10952: 백준 - 109
leejhjava.tistory.com
728x90
'Test > Coding Tests' 카테고리의 다른 글
[BaekJoon] 아스키 코드 - 11654번 (2) | 2024.10.13 |
---|---|
[BaekJoon] A+B - 4 (0) | 2024.10.06 |
[Programmers] 수 조작하기 1 (0) | 2024.09.17 |
[Programmers] 원소들의 곱과 합 (0) | 2024.08.11 |
[Programmers] 이어 붙인 수 (0) | 2024.08.11 |