python-algorithm

[백준] 10093

무적김두칠 2021. 1. 11. 10:17

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import sys
tmp1,tmp2=map(int,sys.stdin.readline().split())
if tmp1==tmp2:
    print("0")
    exit()
elif tmp1<tmp2 :
    a=tmp1;b=tmp2
else:
    a=tmp2;
    b=tmp1
print(b-a-1)
for i in range(a+1,b):
    if i!=b-1 :print(i,end=' ')
    elseprint(i)
cs

특이사항으로는 입력받는 숫자 a,b가 같은 경우에는 0을 출력해야됩니다!

반응형