조건문1 [백준/파이썬3/2920] 음계 풀이 notes = list(map(int, input().split())) des = True asc = True for i in range(len(notes)-1): if notes[i] notes[i+1]: asc=False if des == False and asc == False: print("mixed") elif des == True: print("descending") elif asc == True: print("ascending") 1. 배열로 입력받고 notes 라는 리스트에 데이터를 저장 2. for문을 사용하여 배열의 길이에서 1개 뺀것 만큼 모든 배열 탐색 3. if문을 사용하여 이전보다 작거나 큰거를 판단하여 틀릴경.. 2019. 12. 24. 이전 1 다음