Advertisement
AlimusSifar

Sofdor Ali Got Mail! - Toph.co - Brute Force

Apr 21st, 2020
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public class solution {
  2.     public static void main(String[] args) {
  3.         String str = "IJ TPGEPS BMJ";
  4.         char[] ch = new char[str.length()];
  5.         for (int i = 0; i < str.length(); i++) {
  6.             if ((int) str.charAt(i) == 32) {
  7.                 ch[i] = (char) ((int) str.charAt(i));
  8.             } else if ((int) str.charAt(i) == 65) {
  9.                 ch[i] = (char) 90;
  10.             } else {
  11.                 ch[i] = (char) ((int) str.charAt(i) - 1);
  12.             }
  13.         }
  14.         str = "";
  15.         for (int i = 0; i < ch.length; i++) {
  16.             str = str + ch[i];
  17.         }
  18.         System.out.print(str);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement