Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace ClassTestSolution
- {
- class Program
- {
- static void Main(string[] args)
- {
- string txt = @"# Sleep tired admins mouse sleeping …
- # Flash drives and keyboards wait guys …
- # Windows, too, goes to bed,
- # That night we had a dream
- # ICQ shut up… Ba-you-buy.
- # All normal contacts asleep long ago …
- # Virus climbs into folders, anyway …
- # Soon he falls too, well, we’ll help him —
- # Databases are updated, the ba-you-buy …";
- Regex.Replace(txt, "[—,….#\r\n]", match => "")
- .Split(' ')
- .GroupBy(x => x)
- .Where(x => x.Key != "")
- .OrderByDescending(x => x.Count())
- .ToList()
- .ForEach(x => Console.Write($@"(""{x.Key}"",{x.Count()}),"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement