译文在下面:
Mission: May 8, try your best to take Halifax. We will support you
下面是完整的程序,有几个地方你搞错了,我帮你修正了。
public class J_Crack {
public static void main(String[] args) {
int i;
StringBuffer s = new StringBuffer(
"flb gilkkfh oord vD .czurozS vpzg lg ghvy iflb big ,8 bzN :mlrhhrN");// 括号中为机密电报
for (i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c >= 'a' && c <= 'z') {
s.setCharAt(i, (char) ('z' - (c - 'a')));
}
if (c >= 'A' && c <= 'Z') {
s.setCharAt(i, (char) ('Z' - (c - 'A')));
}
}
s.reverse();
System.out.println(s);
}
}
public class J_Crack
{
public static void main(String[] args)
{
int i;
StringBuffer s=new StringBuffer("flb gilkkfh oord vD .czurozS vpzg lg ghvy iflb big ,8 bzN :mlrhhrN");//括号中为机密电报
for(i=0;i
char c=s.charAt(i);
if(c>='a'&&c<='z')
{
s.setCharAt(i,(char)('z'-('c'-'a')));
}
if(c>='A'&&c<='Z')
{
s.setCharAt(i,(char)('Z'-('c'-'A')));
}
}
s.reverse();
System.out.println(s);
}
}
这是啥