import javax.swing.*;
public class Test1
{
public static void main(String []arg)throws java.io.IOException
{
loop:while(true)
{int i;
int c;
for(i=0;i<10;i++)
switch(c=System.in.read())
{case 'j':
case 'q':
break loop;
default:
System.out.println(i);
}
}
}
}我输入1后,显示结果如下:1
0
1
2
public class Test1
{
public static void main(String []arg)throws java.io.IOException
{
loop:while(true)
{int i;
int c;
for(i=0;i<10;i++)
switch(c=System.in.read())
{case 'j':
case 'q':
break loop;
default:
System.out.println(i);
}
}
}
}我输入1后,显示结果如下:1
0
1
2
windows操作系统把回车键当作'\r'回车字符和'\n'换行字符来处理的
请问下,为什么我输入字母w时,会显示 0
1
2
这是什么意思了?