import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
StringBuffer sb = new StringBuffer("");
String m = "";
int cases = Integer.parseInt(br.readLine());
for (int i = 0; i < cases; i++) {
String str1=br.readLine();
String str2=br.readLine();
sb.append("Case ").append((i+1)).append(": ");
if(str1.equals(str2)){
sb.append("Yes").append("\n");
}else{
StringBuilder temp1=new StringBuilder();
StringBuilder temp2=new StringBuilder();
for(int j=0;j<str1.length();j++){
if(str1.charAt(j)!=' ')
temp1.append(str1.charAt(j));
}
for(int j=0;j<str2.length();j++){
if(str2.charAt(j)!=' ')
temp2.append(str2.charAt(j));
}
if(temp1.toString().equals(temp2.toString())){
sb.append("Output Format Error").append("\n");
}else{
sb.append("Wrong Answer").append("\n");
}
}
}
System.out.print(sb);
}
}
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
StringBuffer sb = new StringBuffer("");
String m = "";
int cases = Integer.parseInt(br.readLine());
for (int i = 0; i < cases; i++) {
String str1=br.readLine();
String str2=br.readLine();
sb.append("Case ").append((i+1)).append(": ");
if(str1.equals(str2)){
sb.append("Yes").append("\n");
}else{
StringBuilder temp1=new StringBuilder();
StringBuilder temp2=new StringBuilder();
for(int j=0;j<str1.length();j++){
if(str1.charAt(j)!=' ')
temp1.append(str1.charAt(j));
}
for(int j=0;j<str2.length();j++){
if(str2.charAt(j)!=' ')
temp2.append(str2.charAt(j));
}
if(temp1.toString().equals(temp2.toString())){
sb.append("Output Format Error").append("\n");
}else{
sb.append("Wrong Answer").append("\n");
}
}
}
System.out.print(sb);
}
}
No comments:
Post a Comment