Advertisement
Krasimir_Slavov

Untitled

Mar 7th, 2019
954
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4.  
  5. namespace Lab_Arr_Repeat_String
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             int n = int.Parse(Console.ReadLine());
  12.             string input = Console.ReadLine();
  13.  
  14.             string result = StringRepeat(input, n);            
  15.             Console.Write(result);
  16.         }
  17.  
  18.         private static string StringRepeat(string input, int n)
  19.         {
  20.             StringBuilder result = new StringBuilder();
  21.             for (int i = 0; i < n; i++)
  22.             {
  23.                 result.Append(input);
  24.             }
  25.             return result.ToString();
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement