Pagini recente » Cod sursa (job #1445591) | Cod sursa (job #1860605) | Cod sursa (job #2689103) | Cod sursa (job #939880) | Cod sursa (job #2998445)
'''
Online Python Compiler.
Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.
arr=[6,3,7,2,63,55]
for i in range(1,len(arr)):
j=i
while j>0 and arr[j]<arr[j-1]:
arr[j],arr[j-1]=arr[j-1],arr[j]
j=j-1
print(arr)
'''
f=open('algsort.in','r')
n=int(f.readline())
arr=[int(x) for x in f.readline().split()]
sortat=[0]*(max(arr)+1)
for i in range(0,len(arr)):
sortat[arr[i]]+=1
fout=open('algsort.out','w')
for i in range(0,max(arr)+1):
while sortat[i]:
print(i,end=" ",file=fout)
sortat[i]=sortat[i]-1