Follows 489.c (Total 38 lines):

/* @JUDGE_ID:4461XX 489 C */
/* A */
#include<stdio.h>
#define max 100
void main( void )
{
/*	freopen( "C:\\windows\\desktop\\489.in" , "r" , stdin ) ;*/
	while( 1 ){
		int n , i , j , arr0[max] , killed=0 , yes , man=0 ;
		char arr[2][max] ;
		scanf( "%d\n" , &n ) ;
		if( n == -1 ) break ;
		printf( "Round %d\n" , n ) ;
		for( i=0 ; i<max ; i++ ) arr0[i] = 0 ;
		for( i=0 ; i<2 ; i++ ) gets( arr[i] ) ;
		for( i=0 ; i<strlen(arr[1]) ; i++ ){
			for( j=0 , yes=0 ; j<strlen(arr[0]) ; j++ )
				if( arr[1][i] == arr[0][j] && !arr0[j] ){
					arr0[j] = 1 ;
					yes = 1 ;
					man++ ;
				}
			if( !yes ) killed++ ;
			if( killed<7 ){
				if( man == strlen(arr[0]) ){
					puts( "You win." ) ;
					goto END ;
				}
			}
			else{
				puts( "You lose." ) ;
				goto END ;
			}
		}
		puts( "You chickened out." ) ;
		END:
	}
}

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