Submission #144151


Source Code Expand

Copy
import java.util.Scanner;

class Main {
	private static void main(String[] args){
		int output[] = new int[S.length()];

		Scanner keyboard = new Scanner(System.in);

		String S = keyboard.nextLine();



		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 873 Byte
Status

Compile Error

./Main.java:5: error: cannot find symbol
		int output[] = new int[S.length()];
		                       ^
  symbol:   variable S
  location: class Main
./Main.java:29: error: cannot find symbol
		System.out.println(Arrays.toString(output));
		                   ^
  symbol:   variable Arrays
  location: class Main
2 errors