Submission #144649


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 (i=0; i<input.length(); i++){
			for (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 707 Byte
Status

Compile Error

./Main.java:8: error: cannot find symbol
		for (i=0; i<input.length(); i++){
		     ^
  symbol:   variable i
  location: class Main
./Main.java:8: error: cannot find symbol
		for (i=0; i<input.length(); i++){
		          ^
  symbol:   variable i
  location: class Main
./Main.java:8: error: cannot find symbol
		for (i=0; i<input.length(); i++){
		                            ^
  symbol:   variable i
  location: class Main
./Main.java:9: error: cannot find symbol
			for (j=65; j<91; j++){
			     ^
  symbol:   variable j
  location: class Main
./Main.java:9: error: cannot find symbol
			for (j=65; j<91; j++){
			           ^
  symbol:   variable j
  location: class Main
./Main.java:9: error: cannot find symbol
			for (j=65; j<91; j++){
			                 ^
  symbol:   variable j
  location: class Main
./Main.java:10: error: cannot find symbol
				String chk = new String[] {input.substring(0,i) + (char)j + input.substring(i+1,input.length())} ;
				                                             ^
  symbol:   varia...