java 程序求解,求大神们解答
import java.util.*;public class CompareString
{
public static void main(String[] args)
{
while (true)
{
Scanner in = new Scanner(System.in);
char[] input=in.next().toCharArray();
StringBuffer output=new StringBuffer();
int num=0;
for(char ch:input) //这一句是什么意思呢????????????????????????
{
if(Character.isUpperCase(ch))
{
num=ch-'A'+27;
}
else
{
num=ch-'a'+1;
}
num=(num*num+num+1)%52;
if(num>26)
{
output.append((char) (num-27+65));
}
else
{
output.append((char) (num+97-1));
}
}
System.out.println(output.toString()); //output已经是字符串了,为什么还要用toString转化成字符串呢????????????????
}
}
}
求大神们解答,不甚感激