import java.io.*;
import java.util.*;
class Telefon {
public static void main(String[] args) throws Exception {
/* IO */
BufferedReader sisend = new BufferedReader(new FileReader("telefon.sis")); // IN
PrintWriter valjund = new PrintWriter(new BufferedWriter(new FileWriter("telefon.out"))); // Out
int n = Integer.parseInt(sisend.readLine()); // Reading first integer
String abi;
String abi2;
String[] numbrid = new String[n]; // Numbers for array
for ( int l = 0; l < n; l++ ) {
numbrid[l] = sisend.readLine();
for ( int j = 1; j < numbrid.length - 1; j++ ) {
if ( numbrid[l].equals( numbrid[j] ) && l != j ) {
valjund.println("JAH"); // Yes
abi = numbrid[l];
abi2 = numbrid[j];
valjund.println(abi);
valjund.println(abi2);
}
else {
valjund.println("EI"); // NO
valjund.close();
}
}
}
sisend.close(); // Input close
valjund.close(); // Output close
}
}
Hey, here is my problem:
Input:
3
12345
123456
123
It is necessary to check number eguals next line numbers.
Example 12345 equals 123456.
4
123
1223
146777
1467778
Example 146777 equals 1467778.
And output
YES
146777
1467778
Sorry my bad .........