Created
May 10, 2019 14:38
-
-
Save Morzanne/1ef127dfe0d2a91a4a60898e9924eb2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Decipherer { | |
public static String automatisation(String code){ | |
int longueur = code.length() / 2; | |
String substr = code.substring(5,(longueur+5)); | |
String replace = substr.replace("@#?"," "); | |
String reverse = new StringBuilder(replace).reverse().toString(); | |
return reverse; | |
} | |
public static void main(String[] args) { | |
String firstCode = "0@sn9sirppa@#?ia'jgtvryko1"; | |
String secondCode = "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj"; | |
String thirdCode = "aopi?sedohtém@#?sedhtmg+p9l!"; | |
System.out.println(automatisation(firstCode)+" "+(automatisation(secondCode))+" "+(automatisation(thirdCode))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment