Follows 10093.c (Total 48 lines):

/* @JUDGE_ID:4461XX 10093 C */
/* A */
#include<stdio.h>
#include<ctype.h>
#include<math.h>
int big ;
double count( char ch )
{
	if( isdigit( ch ) ){
		if( ch-'0' > big ) big = ch-'0' ;
		return ch-'0' ;
	}

	if( isupper( ch ) ){
		if( ch-'A'+10 > big ) big = ch-'A'+10 ;
		return ch-'A'+10 ;
	}

	if( islower( ch ) ){
		if( ch-'a'+36 > big ) big = ch-'a'+36 ;
		return ch-'a'+36 ;
	}

	return 0 ;
}
void main( void )
{
	char ch ;
	double num ;
	while( scanf( "%c" , &ch ) == 1 ){
		if( ch=='\n' ) continue ;
		num = 0.0 ;
		big = 1 ;
		num += count( ch ) ;
		for( ; ; ){
			scanf( "%c" , &ch ) ;
			if( ch=='\n' ) break ;
			num += count( ch ) ;
		}
		for( ; big<62 ; big++ )
			if( !( fmod( num , (double)big ) ) ){
				printf( "%d\n" , big+1 ) ;
				break ;
			}
		if( big==62 ) puts( "such number is impossible!" ) ;
	}
}
/* @END_OF_SOURCE_CODE */

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