19 lines
313 B
Text
19 lines
313 B
Text
|
|
using System;
|
||
|
|
using System.Console;
|
||
|
|
|
||
|
|
module StrRep
|
||
|
|
{
|
||
|
|
Repeat(this s : string, n : int) : string
|
||
|
|
{
|
||
|
|
String('x', n).Replace("x", s)
|
||
|
|
}
|
||
|
|
|
||
|
|
Main() : void
|
||
|
|
{
|
||
|
|
WriteLine("ha".Repeat(5));
|
||
|
|
WriteLine("*".Repeat(5));
|
||
|
|
WriteLine(String('*', 5)); // repeating single char
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|