Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ProgrammingBasics;
- import java.util.Scanner;
- public class AAA {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String username = scanner.nextLine();
- String password = scanner.nextLine();
- int b = password.length();
- boolean same = false;
- for (int i = 0; i < username.length(); i++) {
- System.out.println(username.charAt(i));
- for (int j = password.length(); j >0; j--){
- if (username.charAt(i) == password.charAt(j-1)) {
- System.out.println(password.charAt(j-1));
- same = true;
- break;
- } else{
- same=false;
- break;
- }
- }
- }if(same==true) {
- System.out.println("WIN");
- }
- else{
- System.out.println("false");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement