MiroslavKisov

ReverseAndExclude

Feb 5th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace ReverseAndExclude
  5. {
  6.     public class StartUp
  7.     {
  8.         public static void Main()
  9.         {
  10.             var input = Console.ReadLine()
  11.                 .Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries)
  12.                 .Select(int.Parse)
  13.                 .ToArray();
  14.             int number = int.Parse(Console.ReadLine());
  15.             input = input.Where(n => n % number != 0).ToArray();
  16.             Array.Reverse(input);
  17.             Console.WriteLine(string.Join(" ", input));
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment