Advertisement
SergeyPGUTI

7.2.5

Nov 26th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main {
  3.  
  4.  
  5.     static boolean  Compare(String a,String b)
  6.     {
  7.         if (a.length()!=b.length()) return false;
  8.         for (int i=0,Length=a.length();i<Length;i++)
  9.         {
  10.             if (a.charAt(i)!=b.charAt(i)) return false;
  11.         }
  12.         return true;
  13.     }
  14.  
  15.     public static void main(String[] args) {
  16.         Scanner in = new Scanner(System.in);
  17.         String a=in.nextLine();
  18.         String b=in.nextLine();
  19.         if (Compare(a,b))  System.out.println("YES");
  20.             else System.out.println("NO");
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement