Skip to content

Instantly share code, notes, and snippets.

@6LYTH3
Created July 15, 2011 04:50
Show Gist options
  • Save 6LYTH3/1084093 to your computer and use it in GitHub Desktop.
Save 6LYTH3/1084093 to your computer and use it in GitHub Desktop.
git clone - abbreviation[String]
package main;
import java.io.File;
import java.util.Scanner;
public class hello {
public static void main(String[] args)throws Throwable /*ท่าไม้ตาย*/ {
File file = new File("test.txt");
Scanner scan = new Scanner(file);
int Tc = scan.nextInt();
int w1 = 0, w2 = 0;
while (Tc-- > 0) {
String W1 = "", W2 = "";
w1 = scan.nextInt();
for (int i = 0; i < w1; i++) {
W1 += scan.next().charAt(0);
}
w2 = scan.nextInt();
if (w1 != w2) {
System.out.println("DIFFERRENT");
break;
}
for (int j = 0; j < w1; j++) {
W2 += scan.next().charAt(0);
if (W2.equals(W1.charAt(j))) {
System.out.println("DIFFERRENT");
break;
}
}
System.out.println("SAME");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment