Follows 414.c (Total 33 lines):

/* @JUDGE_ID:4461XX 414 C */
/* A */
#include<stdio.h>
char arr[15][26] ;
int space[15] ;
void count( int less , int n )
{
	int i , ans=0 ;
	for( i=0 ; i<n ; i++ ) ans += space[i] - less ;
	printf( "%d\n" , ans ) ;
}
int find_space( int n )
{
	int i , j , spaces , less=25 ;
	for( i=0 ; i<n ; i++ ){
		for( j=0 , spaces=0 ; j<24 ; j++ )
			if( arr[i][j] == ' ' ) spaces++ ;
		space[i] = spaces ;
		if( spaces<less ) less = spaces ;
	}
	return less ;
}
void main( void )
{
	int n , i ;
/*	freopen( "C:\\windows\\desktop\\414.in" , "r" , stdin ) ;*/
	while( 1 ){
		scanf( "%d\n" , &n ) ;
		if( !n ) break ;
		for( i=0 ; i<n ; i++ ) gets( arr[i] ) ;
		count( find_space( n ) , n ) ;
	}
}

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