Skip to content

Commit 9999277

Browse files
authored
Create 1.py
1 parent bdc9ab4 commit 9999277

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

6/1.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
array = [7, 5, 9, 0, 3, 1, 6, 2, 4, 8]
2+
3+
for i in range(len(array)):
4+
min_index = i # 가장 작은 원소의 인덱스
5+
for j in range(i + 1, len(array)):
6+
if array[min_index] > array[j]:
7+
min_index = j
8+
array[i], array[min_index] = array[min_index], array[i] # 스와프
9+
10+
print(array)

0 commit comments

Comments
 (0)