Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp2
  4. {
  5. public class Text
  6. {
  7. public void Testing(string str)
  8. {
  9. int res;
  10. for (int i = 0; i < str.Length; i++)
  11. {
  12. if (Int32.TryParse(str[i].ToString(), out res))
  13. {
  14. int number = Convert.ToInt32(str[i].ToString());
  15. for (int j = 1; j < number; j++)
  16. {
  17. Console.Write(str[i - 1]);
  18. }
  19. }
  20. else
  21. {
  22. Console.Write(str[i]);
  23. }
  24. }
  25. }
  26. }
  27. class Program
  28. {
  29. static void Main(string[] args)
  30. {
  31. string str = Console.ReadLine();
  32. Text txt = new Text();
  33. txt.Testing(str);
  34. Console.ReadKey();
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement