Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _07._Repeat_String
- {
- class Program
- {
- static void Main(string[] args)
- {
- string stringToRepeat = Console.ReadLine();
- int repeatCount = int.Parse(Console.ReadLine());
- string repeatedString = MakeRepeatedString(stringToRepeat, repeatCount);
- Console.WriteLine(repeatedString);
- }
- static string MakeRepeatedString (string stringToRepeat,int repeatCount)
- {
- string repeat = string.Empty;
- for(int i=1; i<= repeatCount; i++)
- {
- repeat += stringToRepeat;
- }
- return repeat;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment