Created
March 17, 2020 16:44
-
-
Save swann44/a8ef823de84b7d11978aa440fab93cc6 to your computer and use it in GitHub Desktop.
Java5
This file contains hidden or 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
| class Decipherer { | |
| public static void main(String[] args) { | |
| String[] messages = { | |
| "0@sn9sirppa@#?ia'jgtvryko1", | |
| "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj", | |
| "aopi?sedohtém@#?sedhtmg+p9l!", | |
| }; | |
| for (int i = 0; i < messages.length; i= i + 1) { | |
| int chiffre_clé = (messages[i].length())/2; | |
| String sous_chaîne = messages[i].substring(5, 5 + chiffre_clé); | |
| String sous_chaînebis = sous_chaîne.replace ( "@#?", " "); | |
| String revers = new StringBuffer(sous_chaînebis).reverse().toString(); | |
| System.out.println(revers); | |
| }; | |
| } | |
| } |
This file contains hidden or 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
| wilder@wilder-ThinkPad-T440p:~/JavaProjects/JavaCode$ java Decipherer | |
| 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