forked from teddyzhang1976/ThinkInJava4thSampleCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEcho.java
More file actions
17 lines (16 loc) · 466 Bytes
/
Echo.java
File metadata and controls
17 lines (16 loc) · 466 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//: io/Echo.java
package io; /* Added by Eclipse.py */
// How to read from standard input.
// {RunByHand}
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
}
} ///:~