为什么这段public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
InputStream ins=System.in;
while(true){
StringBuilder sb=new StringBuilder();
int ch=ins.read();
if(ch=='\r')
continue;
else if(ch=='\n'){
String s=sb.toString();
if(s.equals("over"))
break;
System.out.println(s.toUpperCase());
// sb.delete(0, sb.length());
}else
sb.append((char)ch);
}
}
程序出不来结果呢 |
|