Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- namespace RageQuit
- {
- class Program
- {
- static void Main()
- {
- string user = Console.ReadLine().ToUpper();
- Regex test = new Regex(@"(\D+)(\d+)");
- StringBuilder result = new StringBuilder();
- foreach (Match a in test.Matches(user))
- {
- StringBuilder res = new StringBuilder();
- string txt = a.Groups[1].Value;
- int repeat = int.Parse(a.Groups[2].Value);
- for (int i = 0; i < repeat; i++)
- {
- res.Append(txt);
- }
- result.Append(res);
- }
- Console.WriteLine("Unique symbols used: {0}",result.ToString().Distinct().Count());
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement