AtCoder Beginner Contest 003

Submission #1769488

Source codeソースコード

import java.util.*;
public class main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] p = sc.nextLine().split("");
        String[] q = sc.nextLine().split("");
        String r = "a,t,c,o,d,e,r";
        String[] s = r.split(",");
        for(int i = 0; i < p.length; i++){
            if(q[i].equals(p[i])) continue;
            else if("@".equals(p[i])){
                if(s[0].equals(q[i]) || s[1].equals(q[i]) || s[2].equals(q[i]) || s[3].equals(q[i]) || s[4].equals(q[i]) || s[5].equals(q[i]) || s[6].equals(p[i]) ) continue;
                else System.out.println("You will lose"); return;
            }
            else if("@".equals(q[i])){
                if(s[0].equals(p[i]) || s[1].equals(p[i]) || s[2].equals(p[i]) || s[3].equals(p[i]) || s[4].equals(p[i]) || s[5].equals(p[i]) || s[6].equals(p[i]) ) continue;
                else System.out.println("You will lose"); return;
            }
            else System.out.println("You will lose"); return; 
        }
        System.out.println("You can win");        
    }
}

Submission

Task問題 B - AtCoderトランプ
User nameユーザ名 pXx36kNXKc19ENzD
Created time投稿日時
Language言語 Java8 (OpenJDK 1.8.0)
Status状態 CE
Score得点 -
Source lengthソースコード長 1121 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.java:2: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error

Test case