OnJava8-Examples/io/Echo.java

18 lines
480 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: io/Echo.java
2015-05-29 14:18:51 -07:00
// <20>2015 MindView LLC: see Copyright.txt
2015-04-20 15:36:01 -07:00
// How to read from standard input.
2015-05-05 11:20:13 -07:00
// {TimeOutDuringTesting}
2015-04-20 15:36:01 -07:00
import java.io.*;
public class Echo {
public static void main(String[] args)
throws IOException {
BufferedReader stdin = new BufferedReader(
new InputStreamReader(System.in));
String s;
while((s = stdin.readLine()) != null && s.length()!= 0)
System.out.println(s);
// An empty line or Ctrl-Z terminates the program
}
} ///:~