public class CCipher {
public static void main(String args[]) {
new CCipher();
}
public CCipher() {
System.out.println(decode("LIPPSASVPH", 4));
}
public String decode(String cipherText, int shift) {
char[] cc = cipherText.toCharArray();
// System.out.println((int)'A');
// System.out.println((int)'_');
for (int i = 0; i < cc.length; i++) {
if (cc[i] - 'A' - shift < 0) {
cc[i] = (char) ('Z' + cc[i] - shift - 'A'+1);
} else {
cc[i] = (char) (cc[i] - shift);
}
}
return new String(cc);
}
}
public static void main(String args[]) {
new CCipher();
}
public CCipher() {
System.out.println(decode("LIPPSASVPH", 4));
}
public String decode(String cipherText, int shift) {
char[] cc = cipherText.toCharArray();
// System.out.println((int)'A');
// System.out.println((int)'_');
for (int i = 0; i < cc.length; i++) {
if (cc[i] - 'A' - shift < 0) {
cc[i] = (char) ('Z' + cc[i] - shift - 'A'+1);
} else {
cc[i] = (char) (cc[i] - shift);
}
}
return new String(cc);
}
}