Softeer: 8단 변속기
2021. 10. 8. 16:58ㆍAlgorithm
- 목차
반응형
import sys
gears = list(map(int, sys.stdin.readline().split()))
pre = gears[0]
order = 'mixed'
for i in range(1, len(gears)):
if pre >= gears[i]:
break
pre = gears[i]
else:
order = 'ascending'
for i in range(1, len(gears)):
if pre <= gears[i]:
break
pre = gears[i]
else:
order = 'descending'
print(order)
반응형