Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- namespace StringExplosion
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- int strength = 0;
- for(int i = 0; i < input.Length; i++)
- {
- if (input[i].Equals('>'))
- {
- strength += int.Parse(input[i + 1].ToString());
- }
- else
- {
- if (strength != 0)
- {
- input = input.Remove(i, 1);
- i--;
- strength--;
- }
- }
- }
- Console.WriteLine(input);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement