Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- class CorrectBrackets
- {
- static void Main()
- {
- string text = Console.ReadLine();
- StringBuilder result = new StringBuilder();
- string[] textSplitN1 = text.Split(new[] { "<a href=\"", "\">", "</a>" }, StringSplitOptions.None);
- result.Append(textSplitN1[0]);
- for (int i = 1; i < textSplitN1.Length; i += 3)
- {
- result.Append("[");
- result.Append(textSplitN1[i + 1]);
- result.Append("]");
- result.Append("(");
- result.Append(textSplitN1[i]);
- result.Append(")");
- result.Append(textSplitN1[i + 2]);
- }
- Console.WriteLine(result.ToString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement