Submission #144665


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

Compile Error

./Main.java:10: error: incompatible types
				String chk = new String[] {input.substring(0,i) + (char)j + input.substring(i+1,input.length())} ;
				             ^
  required: String
  found:    String[]
./Main.java:11: error: non-static method palindrome_check(String) cannot be referenced from a static context
				if (palindrome_check(chk) == true){
				    ^
2 errors