fork(1) download
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6.  
  7.  
  8. internal class Program
  9. {
  10. private static IEnumerable<T> Infinite<T>(T value){
  11. while (true) yield return value;
  12. }
  13.  
  14. private static void Main(string[] args)
  15. {
  16. foreach (var value in Infinite<string>("qwerty").Take(5))
  17. {
  18. Console.WriteLine(value);
  19. }
  20. }
  21. }
Success #stdin #stdout 0.03s 23920KB
stdin
Standard input is empty
stdout
qwerty
qwerty
qwerty
qwerty
qwerty