Cod sursa(job #2733004)

Utilizator thinkphpAdrian Statescu thinkphp Data 29 martie 2021 18:22:29
Problema Sortare prin comparare Scor 40
Compilator py Status done
Runda Arhiva educationala Marime 0.41 kb
def sorteaza(arr):
    return arr.sort() 

def main():
	#step 1: open files
	fin = open("algsort.in","r")
	fout = open("algsort.out","w")
	#step 2:
	# read the number of elements
	n = int(fin.readline().strip())
	# check the type of the variabile n
	#print(type(n))
	arr = fin.readline().strip().split(" ")
	#print(type(arr))
	arr = [int(i) for i in arr]
	sorteaza(arr)
	for i in arr:
		fout.write(str(i) + " ")

main()