Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- namespace Test_2_03._08._2019_Group_2
- {
- class Program
- {
- static void Main(string[] args)
- {
- string pattern = @"^(\D+)>(\d{3})\|([a-z]{3})\|([A-Z]{3})\|([^\<\>]{3})<\1$";
- int lines = int.Parse(Console.ReadLine());
- for (int i = 0; i < lines; i++)
- {
- string input = Console.ReadLine();
- Match matches = Regex.Match(input, pattern);
- if (matches.Success)
- {
- string password = matches.Groups[2].Value + matches.Groups[3].Value
- + matches.Groups[4].Value + matches.Groups[5].Value;
- Console.WriteLine("Password: "+ password);
- }
- else
- {
- Console.WriteLine("Try another password!");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement