Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class Main{
  5. public static void main(String[] args) {
  6. Scanner in = new Scanner(System.in);
  7. String input = in.next();
  8. if(input.length() != 10) {
  9. System.out.println("you failed");
  10. System.exit(0);
  11. }
  12. String changed = change(input);
  13. if(changed.equals("fvcl{bf335")) {
  14. System.out.println("The flag is: " + input);
  15. } else {
  16. System.out.println("you failed");
  17. }
  18. }
  19. private static String change(String s) {
  20. String temp = “”;
  21. for(int i = 0; i < s.length(); i++) {
  22. temp+= (char)(s.charAt(i) + 3);
  23. }
  24. return temp;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement