Created
October 28, 2019 10:07
-
-
Save wilderwith/f61ce31fe2a9ab213f70ff59f731ddb9 to your computer and use it in GitHub Desktop.
Quete java 5
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 void main(String[] args) | |
{ | |
System.out.println(dechiffre("0@sn9sirppa@#?ia'jgtvryko1")); | |
System.out.println(dechiffre("q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj")); | |
System.out.println(dechiffre("aopi?sedohtém@#?sedhtmg+p9l!")); | |
} | |
public static String dechiffre(String code) | |
{ | |
int coupe_chaine = code.length()/2; | |
int finish_index = 5 + coupe_chaine; | |
code = code.substring(5, finish_index); | |
code = code.replace("@#?", " "); | |
code = new StringBuilder(code).reverse().toString(); | |
return code; | |
} | |
} | |
j'ai appris | |
toutes les ficelles | |
des méthodes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment