Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Text.RegularExpressions;
- namespace _02._Boss_Rush
- {
- class Program
- {
- static void Main(string[] args)
- {
- Regex regex = new Regex(@"^(.+)\>(\d{3})\|([a-z]{3})\|([A-Z]{3})\|([^\<\>]{3})\<(\1)$");
- int times = int.Parse(Console.ReadLine());
- for (int i = 0; i < times; i++)
- {
- string input = Console.ReadLine();
- Match match = regex.Match(input);
- if (match.Success)
- {
- string digit = match.Groups[2].Value;
- string alphabet = match.Groups[3].Value;
- string uppercase = match.Groups[4].Value;
- string symbol = match.Groups[5].Value;
- string pass = string.Concat(digit, alphabet, uppercase, symbol);
- Console.WriteLine($"Password: {pass}");
- }
- else
- {
- Console.WriteLine("Try another password!");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement