Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Vvod():
- File = open('S.txt','w')
- for i in range(7):
- File.write(input('Введите элемент файла: ')+'\n')
- File.close()
- File = open('S.txt')
- File.close()
- def Sort():
- File = open('S.txt')
- dop=File.read()
- File.close()
- dop=dop.replace('\n','')
- for i in range(len(dop)):
- for j in range(i,len(dop)):
- if int(dop[i])>int(dop[j]):
- dop=dop[0:i]+dop[j]+dop[i]+dop[i+1:j]+dop[j+1:]
- File = open('S.txt','w')
- for i in range(len(dop)):
- if i!=len(dop)-1:
- File.write(dop[i]+'\n')
- else:
- File.write(dop[i])
- File.close()
- def Print():
- File = open('S.txt')
- read=File.read()
- print(read)
- File.close()
- Vvod()
- Sort()
- Print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement