javaä¸DataInputStream使ç¨æé åæ°ï¼ä½¿ç¨bufferreaderï¼è¾å
¥åæ°system.inå°±å¯ä»¥è¯»åæ§å¶å°çå符串ï¼å¦ä¸ä»£ç ï¼
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.IOException;
public class ceshi {
public static void main(String[] args) {
DataInputStream in = new DataInputStream(new BufferedInputStream(
System.in));//æ°å»ºDateInputSteamï¼æ¥æ¶æ§å¶å°çä¿¡æ¯
String s;
try {
while ((s = in.readLine()).length() != 0)
System.out.println(s);//读åæ§å¶å°ä¿¡æ¯ï¼å¹¶æå°åºæ¥
// An empty line terminates the program
} catch (IOException e) {
e.printStackTrace();
}
}
}
è¿è¡ç»æå¦ä¸ï¼
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/09fa513d269759ee5100942cb4fb43166c22df81?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)