Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.Text.RegularExpressions;
- namespace ConsoleApp52
- {
- class Program
- {
- static void Main(string[] args)
- {
- int key = int.Parse(Console.ReadLine());
- string text = string.Empty;
- StringBuilder decryptedText = new StringBuilder();
- while ((text = Console.ReadLine()) != "end")
- {
- for (int i = 0; i < text.Length; i++)
- {
- decryptedText.Append((char)((int)text[i] - key));
- }
- }
- string pattern = @"(?<name>(?<=@)[A-Za-z]+)[^@\-!:>]*.(?<behaviour>(?<=!)[G](?=!))";
- MatchCollection names = Regex.Matches(decryptedText.ToString(), pattern);
- foreach(Match name in names)
- {
- string validName = name.Groups["name"].Value;
- Console.WriteLine($"{validName}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement