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=' ')
else: print(i)
|
cs |
특이사항으로는 입력받는 숫자 a,b가 같은 경우에는 0을 출력해야됩니다!
반응형
'python-algorithm' 카테고리의 다른 글
[백준] 10275 (0) | 2021.01.11 |
---|---|
[백준] 10102 (0) | 2021.01.11 |
[백준] 9546 (0) | 2021.01.10 |
[백준] 9086 (0) | 2021.01.10 |
[백준] 9076 (0) | 2021.01.10 |
댓글