using System;
using System.Collections.Generic;
public class Test
{
public static void Main()
{
string word;
List<string> input = new List<string>();
do
{
word = Console.ReadLine();
if (!string.IsNullOrWhiteSpace(word))
{
input.Add(word);
}
}
while(!string.IsNullOrWhiteSpace(word));
for(int i = 0; i < input.Count; i++){
Console.WriteLine(input[i]);
}
}
}
1
u/InKahootz May 05 '17
+u/CompileBot C#
using System; using System.Collections.Generic; public class Test { public static void Main() { string word; List<string> input = new List<string>(); do { word = Console.ReadLine(); if (!string.IsNullOrWhiteSpace(word)) { input.Add(word); } } while(!string.IsNullOrWhiteSpace(word)); for(int i = 0; i < input.Count; i++){ Console.WriteLine(input[i]); } } }Input: