请有人解释下面突出显示的代码行.我根本不明白这条线是如何工作的.
您可以使用此示例来帮助我:
input: ATTACK keyword: LEMON res: LXFOPV
我不明白,行如何帮助编码A,以L和其他信... ACSII参与?
static String encrypt(String text, final String key) {
String res = "";
text = text.toUpperCase();
for (int i = 0, j = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (c < 'A' || c > 'Z') continue;
////////////////////////////////////////////////////////////////////////////
//please someone explain this line
res += (char)((c + key.charAt(j) - 2 * 'A') % 26 + 'A');
////////////////////////////////////////////////////////////////////////
j = ++j % key.length(); …Run Code Online (Sandbox Code Playgroud)