vasildiavolo

dsads

May 18th, 2018
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.Text;
  4.  
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. StringBuilder input = new StringBuilder();
  10. input.Append(Console.ReadLine());
  11. MatchCollection matches = Regex.Matches(input.ToString(), @"<([a-zA-Z])([a-zA-Z])>");
  12.  
  13. for (int i = 0; i < matches.Count; i++)
  14. {
  15. int firstDigit = Convert.ToInt32(char.Parse(matches[i].Groups[1].Value));
  16. int secondDigit = Convert.ToInt32(char.Parse(matches[i].Groups[2].Value));
  17. int power = Math.Abs(firstDigit - secondDigit);
  18.  
  19. if (power > 0)
  20. {
  21. int startBefore = 0;
  22. int endAfter = 0;
  23. string before = null;
  24. string after = null;
  25.  
  26. if (matches[i].Index + 1 >= power)
  27. {
  28.  
  29. }
  30.  
  31. for (int bf = matches[i].Index - power; bf <= matches[i].Index; bf++)
  32. {
  33.  
  34. }
  35.  
  36.  
  37. input.Replace(before, new string('_', before.Length));
  38. input.Replace(after, new string('_', after.Length));
  39. }
  40. input.Replace(matches[i].ToString(), new string('_', 4));
  41. }
  42.  
  43. Console.WriteLine(input.ToString());
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment