Krasimir_Slavov

Untitled

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