Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class solution {
- public static void main(String[] args) {
- String str = "IJ TPGEPS BMJ";
- char[] ch = new char[str.length()];
- for (int i = 0; i < str.length(); i++) {
- if ((int) str.charAt(i) == 32) {
- ch[i] = (char) ((int) str.charAt(i));
- } else if ((int) str.charAt(i) == 65) {
- ch[i] = (char) 90;
- } else {
- ch[i] = (char) ((int) str.charAt(i) - 1);
- }
- }
- str = "";
- for (int i = 0; i < ch.length; i++) {
- str = str + ch[i];
- }
- System.out.print(str);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement