Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- using System.Text;
- class Program
- {
- static void Main(string[] args)
- {
- StringBuilder input = new StringBuilder();
- input.Append(Console.ReadLine());
- MatchCollection matches = Regex.Matches(input.ToString(), @"<([a-zA-Z])([a-zA-Z])>");
- for (int i = 0; i < matches.Count; i++)
- {
- int firstDigit = Convert.ToInt32(char.Parse(matches[i].Groups[1].Value));
- int secondDigit = Convert.ToInt32(char.Parse(matches[i].Groups[2].Value));
- int power = Math.Abs(firstDigit - secondDigit);
- if (power > 0)
- {
- int startBefore = 0;
- int endAfter = 0;
- string before = null;
- string after = null;
- if (matches[i].Index + 1 >= power)
- {
- }
- for (int bf = matches[i].Index - power; bf <= matches[i].Index; bf++)
- {
- }
- input.Replace(before, new string('_', before.Length));
- input.Replace(after, new string('_', after.Length));
- }
- input.Replace(matches[i].ToString(), new string('_', 4));
- }
- Console.WriteLine(input.ToString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment