Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.Text.RegularExpressions;
- class MainClass
- {
- public static void Main (string[] args)
- {
- int index = 0;
- string merl = @"^Merlin\s*speaks";
- string kill = @"Avada-ke-davra";
- string str = Console.ReadLine();
- while(true)
- {
- index = index + 1;
- var merlin = Regex.Match(str, merl);
- if(merlin.Success)
- foreach (Match match in Regex.Matches(str, kill))
- Console.WriteLine($"{index} {match.Index + 1}");
- str = Console.ReadLine();
- if (String.IsNullOrEmpty(str))
- break;
- }
- }
- }
Add Comment
Please, Sign In to add comment