Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. public class Decipherer {
  2. public static String DeciphMethod (String message) {
  3.  
  4. int size = message.length() / 2;
  5.  
  6. String newMessage1 = message.substring(5,size+5);
  7. System.out.println(newMessage1);
  8.  
  9. String newMessages1 = newMessage1.replace("@#?"," ");
  10. System.out.println(newMessages1);
  11.  
  12. String inverse = "";
  13. for(int z = newMessages1.length() - 1;z > -1;--z) {
  14. inverse += newMessages1.charAt(z);
  15. }
  16.  
  17. System.out.println(inverse);
  18.  
  19. return inverse;
  20.  
  21. }
  22. public static void main(String[] args) {
  23.  
  24. String message1 = "0@sn9sirppa@#?ia'jgtvryko1";
  25. String message2 = "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj";
  26. String message3 = "aopi?sedohtém@#?sedhtmg+p9l!";
  27. System.out.println("Resultat : "+DeciphMethod(message1));
  28. System.out.println("Resultat : "+DeciphMethod(message2));
  29. System.out.println("Resultat : "+DeciphMethod(message3));
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement