Advertisement
elena1234

RepeatStrings

Nov 12th, 2020 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace RepeatString
  5. {
  6.     class MainClass
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.             string[] words = Console.ReadLine().Split();
  11.             StringBuilder sb = new StringBuilder();
  12.             foreach (var item in words)
  13.             {
  14.                 for (int i = 1; i <=item.Length ; i++)
  15.                 {
  16.                     sb.Append(item);
  17.                 }
  18.             }
  19.  
  20.             Console.WriteLine(sb);
  21.         }
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement