fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string word;
  9. List<string> input = new List<string>();
  10. do
  11. {
  12. word = Console.ReadLine();
  13. if (!string.IsNullOrWhiteSpace(word))
  14. {
  15. input.Add(word);
  16. }
  17. }
  18. while(!string.IsNullOrWhiteSpace(word));
  19.  
  20. for(int i = 0; i < input.Count; i++){
  21. Console.WriteLine(input[i]);
  22. }
  23. }
  24. }
Success #stdin #stdout 0.01s 131648KB
stdin
one
two
three

stdout
one
two
three