UNB/ CS/ David Bremner/ teaching/ java/ Split.java
import java.util.StringTokenizer;

public class Split
{  public static void main(String[] args)
   {  ConsoleReader console = new ConsoleReader(System.in);
      
      boolean done = false;
      while (!done)
      {  String inputLine = console.readLine();
         if (inputLine == null)
            done = true;
         else
         {  // break input line into words
         
            StringTokenizer tokenizer 
               = new StringTokenizer(inputLine);
            while (tokenizer.hasMoreTokens())
            {  // print each word
            
               String word = tokenizer.nextToken();
               System.out.println(word);
            }
         }
      }
   }
}