✏️백준 1259번 :팰린드롬수
나의 풀이
- Swift
1
2
3
4
5
6
7
8
9
10
11
while true {
let n = readLine()!
if n == "0" {
break
}
if n == String(n.reversed()) {
print("yes")
} else {
print("no")
}
}
- Python
1
2
3
4
5
6
7
8
9
10
11
12
import sys
input = sys.stdin.readline
while True:
num = input().strip()
if num == "0":
break
if num == num[::-1]:
print("yes")
else:
print("no")