Submission #33585


Source Code Expand

Copy
import java.util.Scanner;
import java.util.ArrayList;

public class Code01 {

	static ArrayList<Integer> eNum = new ArrayList<Integer>();
	static int bNum;
	static ArrayList<Integer> lNum = new ArrayList<Integer>();

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		for (int i = 0; i < 6; i++) {
			eNum.add(scan.nextInt());
		}
		bNum = scan.nextInt();
		for (int i = 0; i < 6; i++) {
			lNum.add(scan.nextInt());
		}

		int hit = 0;
		for (int c : eNum) {
			if (lNum.contains(c)) {
				hit++;
			}
		}

		switch (hit) {
		case 6:
			System.out.println("1");
			break;
		case 5:
			if (lNum.contains(bNum)) {
				System.out.println("2");
			} else {
				System.out.println("3");
			}
			break;
		case 4:
			System.out.println("4");
			break;
		case 3:
			System.out.println("5");
			break;
		default:
			System.out.println("0");
		}
	}
}

Submission Info

Submission Time
Task A - 宝くじ
User Satanabe1
Language Java (OpenJDK 1.7.0)
Score 0
Code Size 924 Byte
Status CE

Compile Error

Main.java:4: class Code01 is public, should be declared in a file named Code01.java
public class Code01 {
       ^
1 error