当前位置: 代码迷 >> Java相关 >> 为什么会这样??
  详细解决方案

为什么会这样??

热度:131   发布时间:2007-04-27 15:48:33.0
为什么会这样??
import java.io.*;
public class zuoye3{
public zuoye3(){}
public static void main(String[]args)throws IOException
{
System.out.print(">");
InputStreamReader isr=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(isr);
String strLine;
char a[]=new char[100];

while((strLine=br.readLine())!=null)
{if(strLine.equals("quit"))
{
break;
}
for(int i=0;i<strLine.length();i++)
{
a[i]=(char) ((strLine.charAt(i))+13);
if(a[i]>'Z')
System.out.println((char)((a[i]-'Z')+'a'));
}
for(int j=0;j<strLine.length();j++)
{
System.out.print(a[j]);
}
System.out.println();
System.out.print(">");

}
br.close();
}
}


if(a[i]>'Z')
System.out.println((char)((a[i]-'Z')+'a'));
这里为什么不会返会去输出小写字母而是输出那些符号的??
----------------解决方案--------------------------------------------------------
  相关解决方案