Follows 499.c (Total 31 lines):

/* @JUDGE_ID:4461XX 499 C */
/* A */
#include <stdio.h>
#include <string.h>
void main( void )
{
	char a[100] ; int number[52] , i , big ;
	while( gets(a)!=NULL )
	{
		for( i=0 ; i<52 ; i++ ) number[i]=0 ; big=0 ;
		for( i=0 ; i<strlen(a) ; i++ )
		{
			if( a[i]>='A' && a[i]<='Z' )
			{
				number[a[i]-'A']++ ;
				if( number[a[i]-'A']>big ) big=number[a[i]-'A'] ;
			}
			if( a[i]>='a' && a[i]<='z' )
			{
				number[a[i]-'a'+26]++ ;
				if( number[a[i]-'a'+26]>big ) big=number[a[i]-'a'+26] ;
			}
		}
		for( i=0 ; i<52 ; i++ )
		{
			if( number[i]==big && i<26 ) printf( "%c" , i+'A' ) ;
			if( number[i]==big && i>25 ) printf( "%c" , i+'a'-26 ) ;
		}
		printf( " %d\n" , big ) ;
	}
}

Back to statistics
Ya-Lin Huang (C)
huangyl@gmail.com