yubin_repository/내림차순

29 lines
347 B
Plaintext
Raw Permalink Normal View History

2018-10-21 05:29:05 +00:00
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)