1. 


/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS10/11
* Problem: 11734 Big Number of Teams will Solve This
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=117&page=show_problem&problem=2834
*
* @author Fabian Liebl
* @version 1.0, 10/06/2010
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.088
*/

import java.io.*;

public class Main {

public static void main(String[] args) throws IOException {
BufferedReader inputReader = new BufferedReader(new InputStreamReader(System.in));
int numberOfTests = 0;
String line1 = "";
String line2 = "";

numberOfTests = Integer.parseInt(inputReader.readLine());

for (int i = 0; i < numberOfTests; i++) {
line1 = inputReader.readLine();
line2 = inputReader.readLine();

if (line1.equals(line2)) {
System.out.println("Case " + (i + 1) + ": Yes");
} else {
line1 = line1.replaceAll("\\s", "");
if (line1.equals(line2)) {
System.out.println("Case " + (i + 1) + ": Output Format Error");
} else {
System.out.println("Case " + (i + 1) + ": Wrong Answer");
}
}
}
}

}


2.

package BigNumberOfTeams;

import java.io.*;

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS10/11
* Problem: 11734 Big Number of Teams will Solve This
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=117&page=show_problem&problem=2834
*
* @author Manuel Hager
* @version 1.0, 10/11/2010
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.092
*/
public class Main
{

private static String RemoveSpaces(String tmp)
{
String[] parts = tmp.split("\\s+");

StringBuilder builder = new StringBuilder();
for(String curr :parts)
builder.append(curr);

return builder.toString();
}

public static void main(String[] args) {
try
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

String line = reader.readLine();

if(line == null || !line.matches("\\d+"))
return;

int number = Integer.parseInt(line);

for(int i = 0; i < number; i++)
{
String firstLine = reader.readLine();
String secondLine = reader.readLine();

if(firstLine.equals(secondLine))
System.out.printf("Case %d: Yes%n", (i + 1) );

else if(firstLine.toLowerCase().equals(secondLine.toLowerCase()))
System.out.printf("Case %d: Wrong Answer%n", (i + 1));

else if(RemoveSpaces(firstLine).equals(secondLine))
{
System.out.printf("Case %d: Output Format Error%n", (i + 1));
}
else
System.out.printf("Case %d: Wrong Answer%n", (i + 1) );
}

reader.close();
}
catch(Exception ex) {

}
}
}