Skip to content

Instantly share code, notes, and snippets.

@wilderwith
Created October 28, 2019 10:07
Show Gist options
  • Save wilderwith/f61ce31fe2a9ab213f70ff59f731ddb9 to your computer and use it in GitHub Desktop.
Save wilderwith/f61ce31fe2a9ab213f70ff59f731ddb9 to your computer and use it in GitHub Desktop.
Quete java 5
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