Advertisement
unrealbg

Untitled

Jan 21st, 2021 (edited)
842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace Concurency
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             List<int> input = Console.ReadLine()
  12.                 .Split()
  13.                 .Select(x => int.Parse(x))
  14.                 .ToList();
  15.  
  16.             input.RemoveAll(x => x == input[input.Count - 1]);
  17.  
  18.             Console.WriteLine(string.Join(' ', input));
  19.  
  20.             // [Втори начин на принтиране на резултата]
  21.             //input.ForEach(x => Console.Write(x + " "));
  22.  
  23.             // [Трети начин на принтиране на резултата]
  24.             //foreach (var item in input)
  25.             //{
  26.             //    Console.Write(item + " ");
  27.             //}
  28.  
  29.             // [Четвърти начин на принтиране на резултата]
  30.             //for (int i = 0; i < input.Count; i++)
  31.             //{
  32.             //    Console.Write(input[i] + " ");
  33.             //}
  34.         }
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement