Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp2
- {
- public class Text
- {
- public void Testing(string str)
- {
- int res;
- for (int i = 0; i < str.Length; i++)
- {
- if (Int32.TryParse(str[i].ToString(), out res))
- {
- int number = Convert.ToInt32(str[i].ToString());
- for (int j = 1; j < number; j++)
- {
- Console.Write(str[i - 1]);
- }
- }
- else
- {
- Console.Write(str[i]);
- }
- }
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- string str = Console.ReadLine();
- Text txt = new Text();
- txt.Testing(str);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement