Submission #144251


Source Code Expand

Copy
import java.util.Scanner;
import java.util.Arrays;

public class contest19a{
	public static void main(String[] args){
		Scanner keyboard = new Scanner(System.in);
		String S = keyboard.nextLine();
		int output[] = new int[S.length()];



		for (int i=0; i<S.length(); i++){
			if (S.charAt(i) == 'O' || S.charAt(i) == 'D'){
				output[i] = 0;
			} else if (S.charAt(i) == 'I'){
				output[i] = 1;
			} else if (S.charAt(i) == 'Z'){
				output[i] = 2;
			} else if (S.charAt(i) == 'S'){
				output[i] = 5;
			} else if (S.charAt(i) == 'B'){
				output[i] = 8;
			} else {
				output[i] = Character.getNumericValue(S.charAt(i));
			}
		}

		System.out.println(Arrays.toString(output));

		/*
		char[] result = new char[S.length()];

		int count = 0;
		for (char letter : result){
			letter = (char)output[count];
			count++;
		}
		System.out.println(result);
		*/
	}
}

Submission Info

Submission Time
Task A - お買い物クライシス
User coffeeapple
Language Java (OpenJDK 1.7.0)
Score 0
Code Size 906 Byte
Status

Compile Error

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