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;
- using System.Runtime.InteropServices;
- using System.Data;
- using System.IO;
- using System.Reflection.PortableExecutable;
- namespace _02._Boss_Rush
- {
- class Program
- {
- static void Main(string[] args)
- {
- Regex regex = new Regex(@"\|(?<boss>[A-Z]+)\|:#(?<title>[a-zA-Z]+\s[a-zA-Z]+)#");
- 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 boss = match.Groups["boss"].Value;
- string title = match.Groups["title"].Value;
- Console.WriteLine($"{boss}, The {title}");
- Console.WriteLine($">> Strength: {boss.Length}");
- Console.WriteLine($">> Armour: {title.Length}");
- }
- else
- {
- Console.WriteLine("Access denied!");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement