BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
可以读取一个文本内容,然后从缓冲区读取到磁盘
scanner in=new scanner(System.in);
直接读取到磁盘
常用的地方:
算法题,输入多行后输出多行内容
本文介绍使用Java中的BufferedReader结合InputStreamReader进行文本内容的缓冲读取,并对比使用Scanner直接读取的方法。适用于算法题中多行输入输出场景。
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
可以读取一个文本内容,然后从缓冲区读取到磁盘
scanner in=new scanner(System.in);
直接读取到磁盘
常用的地方:
算法题,输入多行后输出多行内容

被折叠的 条评论
为什么被折叠?