fork download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. public class Test
  6. {
  7. public static String duplicateChars(IEnumerable<Char> input, int factor)
  8. {
  9. var chars = from c in input
  10. from cc in Enumerable.Repeat(c, factor)
  11. select cc;
  12. return new String(chars.ToArray());
  13. }
  14.  
  15.  
  16. public static void Main()
  17. {
  18. Console.Write(duplicateChars("123", 2));
  19. }
  20. }
Success #stdin #stdout 0.04s 36936KB
stdin
Standard input is empty
stdout
112233