给点提示,象这样:
import java.io.*;public class Echo {
  public static void main(String[] args) {
    DataInputStream in =
      new DataInputStream(
        new BufferedInputStream(System.in));
    String s;
    try {
      while((s = in.readLine()).length() != 0)
       if(1 == Integer.parseInt(s)){
       System.out.println("this is 1");
       }else if(2 == Integer.parseInt(s)){
       System.out.println("this is 2");
       }
        System.out.println(s);
      // An empty line terminates the program
    } catch(IOException e) {
      e.printStackTrace();
    }
  }
}
//////////////
该知道怎么做了吧!