Home [1일 1문제] 3월 10일 문제풀이
Post
Cancel

[1일 1문제] 3월 10일 문제풀이

백준 1330번 : 두 수 비교하기

문제

나의 풀이

1
2
3
4
5
6
7
8
9
10
11
if let input = readLine() {
    let nums = input.split(separator: " ").map{ Int(String($0))! }
    
    if nums[0] > nums[1] {
        print(">")
    } else if nums[0] < nums[1] {
        print("<")
    } else {
        print("==")
    }
}

(추가 예정)

  • 조건문 if
This post is licensed under CC BY 4.0 by the author.