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;
- namespace StringExplosion
- {
- class Program
- {
- static void Main()
- {
- var sb = new StringBuilder(Console.ReadLine());
- int count = 0;
- for (int i = 0; i < sb.Length; i++)
- {
- if (sb[i] == '>')
- {
- continue;
- }
- if (char.IsDigit(sb[i]))
- {
- count += sb[i] - 48;
- }
- if (count != 0)
- {
- sb.Remove(i, 1);
- count--;
- i--;
- }
- }
- Console.WriteLine(sb);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement