Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace T07PredicateForNames
- {
- class Program
- {
- static void Main(string[] args)
- {
- int wordMaxLength = int.Parse(Console.ReadLine());
- Predicate<string> shorterWord = w => w.Length <= wordMaxLength;
- Action<string[]> print = w => Console.WriteLine(string.Join("\n", w));
- print(Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries)
- .Where(x => shorterWord(x)).ToArray());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement