Skip to content

Instantly share code, notes, and snippets.

@Alfian878787
Forked from swann44/fichier.java
Created March 17, 2020 16:45
Show Gist options
  • Save Alfian878787/62917cc294f20f1bdf15b6205050c151 to your computer and use it in GitHub Desktop.
Save Alfian878787/62917cc294f20f1bdf15b6205050c151 to your computer and use it in GitHub Desktop.
Java5
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);
};
}
}
wilder@wilder-ThinkPad-T440p:~/JavaProjects/JavaCode$ java Decipherer
j'ai appris
toutes les ficelles
des méthodes
@Alfian878787
Copy link
Author

<script src="https://gist.github.com/Alfian878787/8c9e72b2e80d63392d357efb7c208329.js"></script>[

repository-open-graph-template
](url)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment