读终端输入数据BufferedReader
public static void main(String[] args) {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
while(true){
try {
String s=br.readLine();
System.out.println(s);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}