Advertisement
jwrbg

ASD

Feb 14th, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. package ProgrammingBasics;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class AAA {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         String username = scanner.nextLine();
  9.         String password = scanner.nextLine();
  10.         int b = password.length();
  11.  
  12.         boolean same = false;
  13.  
  14.  
  15.         for (int i = 0; i < username.length(); i++) {
  16.             System.out.println(username.charAt(i));
  17.  
  18.             for (int j = b ; j > 0;b--){
  19.                 if (username.charAt(i) == password.charAt(j-1)) {
  20.                     System.out.println(password.charAt(j-1));
  21.                     same = true;
  22.                     break;
  23.                 } else{
  24.                         same=false;
  25.                         break;
  26.                     }
  27.  
  28.             }
  29.         }if(same==true) {
  30.             System.out.println("WIN");
  31.         }
  32.         else{
  33.             System.out.println("false");
  34.         }
  35.         }
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement