Problem:
Score : 100 points

Problem Statement

Given is a lowercase English letter C that is not z. Print the letter that follows C in alphabetical order.

Constraints

C is a lowercase English letter that is not z.

Input

Input is given from Standard Input in the following format:

C

Output

Print the letter that follows C in alphabetical order.

Sample Input 1

a

Sample Output 1

b

a is followed by b.

Sample Input 2

y

Sample Output 2

z

y is followed by z.

Solution in C (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <stdio.h>

int h, w;
char s[21][21];

void scan_s(void)
{
	int i, j;
	char dummy;
	
	for(i = 0; i < h; i++){
		scanf("%c", &dummy);
		for(j = 0; j < w; j++)
			scanf("%c", &s[i][j]);
	}
}

int max_sij(int i, int j)
{
	int t[21][21] = {}; t[i][j] = 1;
	int k = 1;
	int repeat = 0;
	while(1){
		for(i = 0; i < h; i++)
			for(j = 0; j < w; j++)
				if(t[i][j] == k){
					if(i > 0 && s[i - 1][j] == '.' && t[i - 1][j] == 0){
						t[i	- 1][j] = k + 1;
						repeat = 1;
					}
					if(j > 0 && s[i][j - 1] == '.' && t[i][j - 1] == 0){
						t[i][j - 1] = k + 1;
						repeat = 1;
					}
					if(s[i][j + 1] == '.' && t[i][j + 1] == 0){
						t[i][j + 1] = k + 1;
						repeat = 1;
					}
					if(s[i + 1][j] == '.' && t[i + 1][j] == 0){
						t[i	+ 1][j] = k + 1;
						repeat = 1;
					}
				}
				
		if(repeat == 0) break;
		else{k++; repeat = 0;}
	}
	
	return k - 1;	
}

int max_way(void)
{
	int i, j;
	int max = 0;
	
	for(i = 0; i < h; i++)
		for(j = 0; j < w; j++){
			int maxij = max_sij(i, j);
			if(maxij > max)
				max = maxij;
		}
	
	return max;
}

int main(void)
{
	scanf("%d%d", &h, &w);
	
	scan_s();
	
	printf("%d", max_way());
	
	return 0;
}