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;
- namespace _10.Rage_Quit
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine().ToUpper();
- List<char> nonRepeatedSymbols = input.Where(x => !char.IsDigit(x)).Distinct().ToList();
- Console.WriteLine($"Unique symbols used: {nonRepeatedSymbols.Count}");
- typeRepeatedStrings(input);
- }
- private static void typeRepeatedStrings(string input)
- {
- List<char> uniqueSymbols = new List<char>();
- StringBuilder currentString = new StringBuilder();
- for (int i = 0; i < input.Length; i++)
- {
- if (!char.IsDigit(input[i]))
- {
- currentString.Append(input[i]);
- }
- else if (char.IsDigit(input[i]))
- {
- for (int j = 0; j < char.GetNumericValue(input[i]); j++)
- {
- Console.Write(currentString);
- }
- currentString.Clear();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement