Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Login {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String username = scanner.nextLine();
- String password = "";
- for (int i = username.length() - 1; i >= 0 ; i--) {
- password = password + username.charAt(i);
- }
- String input_password = scanner.nextLine();
- while(!password.equals(input_password)){
- input_password = scanner.nextLine();
- }
- System.out.printf("User %s logged in.", username);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement