Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace _2_3.Booming_Cannon
- {
- class Program
- {
- static void Main(string[] args)
- {
- var inputLine = Console.ReadLine().Split().Select(int.Parse).ToArray();
- int n = inputLine[0];
- int m = inputLine[1];
- var input = Console.ReadLine();
- var target = new List<string>();
- var pattern = @"(?<=\\[<]{3})\w+";
- var reg = new Regex(pattern);
- var text = reg.Matches(input).Cast<Match>().Select(v => v.Value).ToList();
- foreach (var item in text)
- {
- if (item.Length >= (n + m))
- {
- target.Add(item.Remove(0, n).Substring(0, m));
- }
- else
- {
- return;
- }
- }
- Console.WriteLine(string.Join("/\\", target));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement