fork(2) download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace ConsoleApp1
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. var tr = new List<string> { "1", "2", "3", "4", "5", "6", "7", "8" };
  11. for (int i = 0; i < tr.Count; i += 4)
  12. Console.WriteLine(string.Join("-", tr.GetRange(i, 4)));
  13. Console.ReadLine();
  14. }
  15. }
  16. }
Success #stdin #stdout 0.02s 15056KB
stdin
Standard input is empty
stdout
1-2-3-4
5-6-7-8