Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace _6._Reverse_and_Exclude
- {
- class Program
- {
- static void Main(string[] args)
- {
- Func<List<int>, int, List<int>> func = (collection, divider) =>
- {
- return collection = collection.Where(number => number % divider != 0).ToList();
- };
- List<int> numbers = new List<int>(Console.ReadLine().Split().Select(int.Parse).Reverse());
- int divider = int.Parse(Console.ReadLine());
- Action<List<int>> printCollection = collection => Console.WriteLine(string.Join(" ", collection));
- numbers = func(numbers, divider);
- printCollection(numbers);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment