fork(2) download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. public class Program
  6. {
  7. public static IEnumerable<int> SpecialIndexes()
  8. {
  9. int i=4;
  10.  
  11. while (i<Int32.MaxValue)
  12. {
  13. yield return i++;
  14. yield return i++;
  15. i += 2;
  16. }
  17. }
  18.  
  19. public static void Main(string[] args)
  20. {
  21. var csvString = "G9999999990001800002777107050,G9999999990002777107HMNLAQKPRLLHRAQRWJ010,1,3,29,P,6.74,11.23,07,P,5.25,14.29,08,P,6.89,16.92,07,P,5,4,";
  22.  
  23. var fields = csvString.Split(',');
  24. var selected = SpecialIndexes()
  25. .TakeWhile(i => i<fields.Length)
  26. .Select(i => fields[i]);
  27.  
  28. Console.WriteLine(string.Join(" ", selected.ToArray()));
  29. }
  30. }
  31.  
Success #stdin #stdout 0.01s 37024KB
stdin
Standard input is empty
stdout
29 P 07 P 08 P 07 P