- //: c12:Echo.java
- // How to read from standard input.
- // {RunByHand}
- import java.io.*;
- public class Echo {
- public static void main(String[] args)
- throws IOException {
- BufferedReader in = new BufferedReader(
- new InputStreamReader(System.in));
- String s;
- while((s = in.readLine()) != null && s.length() != 0)
- System.out.println(s);
- // An empty line or Ctrl-Z terminates the program
- }
- } ///:~
Thinking in java 从标准输出读取字符串
最新推荐文章于 2021-03-02 09:18:37 发布