package com.mindprod.example;
import java.util.InputMismatchException;
import java.util.Scanner;
/**
* Demonstrate the use of Scanner
* <p/>
* composed with IntelliJ IDEA
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0, 2007-09-16
*/
public class TestScanner
{
public static void main( String[] args )
{
Scanner sc = new Scanner( System.in, "UTF-8");
sc.useDelimiter( "[\\|\\n]" );
try
{
while ( sc.hasNext() )
{
int i = sc.nextInt();
System.out.println( i );
}
}
catch ( InputMismatchException e )
{
System.err
.println( "problem reading scanner stream: "
+ e.getMessage() );
}
sc.close();
}
}