본문 바로가기
python-algorithm

백준 23343 JavaScript

by 무적김두칠 2023. 1. 3.

https://www.acmicpc.net/problem/23343

 

23343번: JavaScript

Print the result of the minus operation (x - y) on one Line. If the result is an integer, please print it without the decimal point. If the result is not a number, please print NaN.

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
def sol(x, y):
    if x.isdigit() and y.isdigit():
        return int(x)-int(y)
    else:
        return 'NaN'
 
if __name__ == '__main__':
    x, y = map(str, input().split())
    print(sol(x, y))
 
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 6190 Another Cow Number Game  (0) 2023.01.03
백준 16861 Harshad Numbers  (0) 2023.01.03
백준 24267 알고리즘 수업 - 알고리즘의 수행 시간 6  (0) 2023.01.03
백준 11328 Strfry  (0) 2023.01.02
백준 3512 Flat  (0) 2022.12.31

댓글