추가 '내림차순'

This commit is contained in:
kim_yubin 2018-10-21 14:29:05 +09:00
parent f77b33fd1f
commit 81df6d9411
1 changed files with 29 additions and 0 deletions

29
내림차순 Normal file
View File

@ -0,0 +1,29 @@
import random
r=random.randint(1, 10)
a=0
b=0
c=0
t=0
u=0
list=[]
while t<4:
r=random.randint(1, 10)
list.append(r)
t+=1
print(list)
t=0
while t<len(list):
u=t+1
while u < len(list):
if list[t]>list[u]:
c = list[t]
list[t] = list[u]
list[u] = c
u+=1
t+=1
print(list)