fork(10) download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. string input = Console.ReadLine();
  10. string[] bits = Regex.Matches(input, @"\w+(?:\W+\w+){0,4}")
  11. .Cast<Match>()
  12. .Select(match => match.Value)
  13. .ToArray();
  14. foreach (string s in bits)
  15. {
  16. Console.WriteLine(s);
  17. }
  18. }
  19. }
Success #stdin #stdout 0.07s 37360KB
stdin
word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 word13
stdout
word1 word2 word3 word4 word5
word6 word7 word8 word9 word10
word11 word12 word13