Follows 620.c (Total 28 lines):

/* @JUDGE_ID:4461XX 620 C */
/* A */
#include <stdio.h>
#include <string.h>
char a[256] ;
int func( int from , int to )
{
	if( from>to ) return 0 ;
	if( from==to && a[from]=='A' ) return 1 ;
	if( a[from]=='B' && a[to]=='A' ) return func( from+1 , to-1 ) ;
	if( a[to]=='B' && a[to-1]=='A' ) return func( from ,  to-2 ) ;
	else return 0 ;
}
void main( void )
{
	int n , i ;
	scanf( "%d" , &n ) ;
	for( i=0 ; i<n ; i++ ){
		scanf( "%s" , a ) ;
		if( func( 0 , strlen( a )-1 ) ){
			if( strcmp( "A" , a )==0 ) printf( "SIMPLE\n" ) ;
			else if( a[0]=='B' && a[strlen( a )-1]=='A' )
				printf( "MUTAGENIC\n" ) ;
			else printf( "FULLY-GROWN\n" ) ;
		}
		else printf( "MUTANT\n" ) ;
	}
}

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