Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- namespace Orders
- {
- class Program
- {
- static void Main(string[] args)
- {
- while(true)
- {
- string input = Console.ReadLine();
- string pattern = @"([#$%*&])(\w+)\1=(\d+)!!(.*)$";
- Match match = Regex.Match(input, pattern);
- if (match.Success)
- {
- string name = match.Groups[2].Value;
- int length = int.Parse(match.Groups[3].Value);
- string coord = match.Groups[4].Value;
- if (length == coord.Length)
- {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < coord.Length; i++)
- {
- sb.Append((char)(coord[i] + coord.Length));
- }
- Console.WriteLine($"Coordinates found! {name} -> {sb}");
- break;
- }
- //Console.WriteLine(length);
- }
- Console.WriteLine("Nothing found!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement