Submission #1844418


Source Code Expand

import java.io.*;
import java.util.*;

public class Main{
	public static void mian(String args[])throws IOException{
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){

            //1文字以上10文字以下であることが保証されている
			String s = br.readLine();
			String t = br.readLine();

			if(check(s,t)){
             System.out.println("You can win");
			}else{
			  System.out.println("You will lose");	
			}


			}
}         
         private static boolean check(String a,String b){
         	char ch = '@';
         	String str = "atcoder@";
         	int size = a.length();
         	for(int i = 0; i < size; i++){
         		if(a.charAt(i) == ch){
         			if(str.indexof(a.charAt(i)) < 0)
                         return false;
                 }else if(b.charAt(i) == ch){
         			if(str.indexof(b.charAt(i)) < 0)
                         return false;
         		}else{
         			if(a.charAt(i) != b.charAt(i))
         				return false;
         		}
         	}
         	return true;

         }   
}

Submission Info

Submission Time
Task B - AtCoderトランプ
User waito_ss
Language Java7 (OpenJDK 1.7.0)
Score 0
Code Size 1115 Byte
Status CE

Compile Error

./Main.java:27: error: cannot find symbol
         			if(str.indexof(a.charAt(i)) < 0)
         			      ^
  symbol:   method indexof(char)
  location: variable str of type String
./Main.java:30: error: cannot find symbol
         			if(str.indexof(b.charAt(i)) < 0)
         			      ^
  symbol:   method indexof(char)
  location: variable str of type String
2 errors