Advertisement
obedmarsh

03. String Repeater

Jun 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace SoftUni
  6. {
  7.     class Program
  8.     {
  9.     static string RepeatString(string str, int count)
  10.     {
  11.         string repeatedString = string.Empty;
  12.         for (int i = 0; i < count; i++)
  13.         {
  14.             repeatedString += str;
  15.         }
  16.         return repeatedString;
  17.     }        
  18.         static void Main(string[] args)
  19.         {
  20.             string txt = Console.ReadLine();
  21.             int rep = int.Parse(Console.ReadLine());
  22.             Console.WriteLine(RepeatString(txt, rep));
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement