BufferedReader in = new BufferedReader( new InputStreamReader(System.in)) int s = 0; while(true) { try { s = in.read(); in.skip(2); System.out.println(s); } catch (IOException e) { System.err.println("Read Failed"); } } //skip是为了不要回车符的显示,但是还是搞不懂回车符怎么会有两个ascii值
new InputStreamReader(System.in))
int s = 0;
while(true)
{
try
{
s = in.read();
in.skip(2);
System.out.println(s);
}
catch (IOException e)
{
System.err.println("Read Failed");
}
}
//skip是为了不要回车符的显示,但是还是搞不懂回车符怎么会有两个ascii值
回车:13
换行: 10
{
try
{
s = in.read();
if(s=='.') break;
System.out.println(s);
}
catch (IOException e)
{
System.err.println("Read Failed");
}
}