Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using java.util;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Diagnostics;
- namespace SoftSvetlina
- {
- class Program
- {
- static void Main()
- {
- List<int> nums = new List<int>();
- using (StreamReader reader = new StreamReader("numbers.txt"))
- {
- string line;
- while ((line = reader.ReadLine()) != null)
- {
- nums.Add(int.Parse(line));
- }
- }
- nums.Sort();
- Console.WriteLine(string.Join(", ", nums));
- using (StreamWriter writer = new StreamWriter("numberssort.txt"))
- {
- foreach (var item in nums)
- {
- writer.WriteLine(item);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement