Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<int> a = new List<int>();
- using (StreamReader fs = new StreamReader("1111.txt"))
- {
- while (true)
- {
- string temp = fs.ReadLine();
- if (temp == null) break;
- a.Add(Convert.ToInt32(temp)); //считываем и заносим в список
- }
- for (int i = 0; i < a.Count; i++)//проверяем на повторение
- {
- if (a[i] == a[i + 1])
- {
- a.RemoveAt(a[i + 1]);
- }
- }
- for (int i = 0; i < a.Count; i++)//вывод
- {
- Console.WriteLine(a[i]);
- }
- }
- Console.ReadKey();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement