键盘输入若干行,输入空格按回合结束
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
System.out.println("输入空格结束按回车结束");
StringBuffer inputStr = new StringBuffer();
System.out.print("请输入: ");
do {
String line = reader.readLine();
System.out.println(line);
if (line.equals(" ")) {
break;
}
inputStr.append(line+"\n");
} while (true);
System.out.println(inputStr.toString());
}
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));