Submission #144687


Source Code Expand

Copy
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner keyboard = new Scanner(System.in);
		String input = keyboard.nextLine();
		int count = 25 * input.length();
		for (int i=0; i<input.length(); i++){
			for (int j=65; j<91; j++){
				String chk = new String {input.substring(0,i) + (char)j + input.substring(i+1,input.length())} ;
				if (palindrome_check(chk) == true){
					count--;
				}
			}
		}
		System.out.println(count);
	}

	public static boolean palindrome_check(String text){
		int limit = (text.length()/2);
		for (int i=0; i<limit; i++){
			if (text.charAt(i) != text.charAt(limit-i-1)){
				return true;
			}
		}
		return false;
	}
}

Submission Info

Submission Time
Task B - こだわりの名前
User coffeeapple
Language Java (OpenJDK 1.7.0)
Score 0
Code Size 720 Byte
Status

Compile Error

./Main.java:10: error: '(' or '[' expected
				String chk = new String {input.substring(0,i) + (char)j + input.substring(i+1,input.length())} ;
				                        ^
./Main.java:10: error: not a statement
				String chk = new String {input.substring(0,i) + (char)j + input.substring(i+1,input.length())} ;
				                                                        ^
./Main.java:10: error: ';' expected
				String chk = new String {input.substring(0,i) + (char)j + input.substring(i+1,input.length())} ;
				                                                                                             ^
./Main.java:16: error: <identifier> expected
		System.out.println(count);
		                  ^
./Main.java:16: error: <identifier> expected
		System.out.println(count);
		                        ^
./Main.java:19: error: class, interface, or enum expected
	public static boolean palindrome_check(String text){
	              ^
./Main.java:21: error: class, interface, or enum expected
		for (int i=0; i<limit; i+...