import java.io.BufferedReader;
import java.io.InputStreamReader;
public class inputTest {
public static void main(String[] args) {
try(//将system.in对象装换成reader对象
InputStreamReader reader=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(reader)
)
{
String line=null;
while((line=br.readLine())!=null){
if(line.equals("exit")){
System.exit(1);
}
System.out.println("输入内容为:"+line);
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
}