Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Hello {
  3.  
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. StringBuilder a = new StringBuilder(sc.nextLine());
  7. StringBuilder b = new StringBuilder(sc.nextLine());
  8. int counter = 1;
  9. while (counter!=0)
  10. {
  11. if (a.toString().equals(b.reverse().toString())) {
  12. System.out.println("User logged in.");
  13. } else {
  14. System.out.println("Incorrect, try again");
  15. }
  16. }
  17.  
  18. counter++;
  19. if (counter == 4) {
  20. System.out.println("user blocked" );
  21. }
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement