13 lines
378 B
Python
13 lines
378 B
Python
def main():
|
|
with open('data.txt', 'r') as file:
|
|
data = file.readlines()
|
|
numbers = [int(line.strip()) for line in data if line.strip().isdigit()]
|
|
sorted_numbers = sorted(numbers)
|
|
|
|
with open('output.txt', 'w') as outfile:
|
|
for number in sorted_numbers:
|
|
outfile.write(f"{number}\n")
|
|
|
|
if __name__ == '__main__':
|
|
main()
|