Follows 10193.c (Total 58 lines):

/* @JUDGE_ID:4461XX 10193 C */
/* A */
#include<stdio.h>
#include<string.h>

int mypow[30+1] ; /* 2^i */

void MakeMypow( void )
{
	int i ;

	mypow[0] = 1 ;
	for( i=1 ; i<30+1 ; ++i ) mypow[i] = mypow[i-1]*2 ;
}
int GCD( int a , int b )
{
	int tmp ;
	
	while( b ){
		a = a%b ;

		tmp = a ;
		a = b ; 
		b = tmp ;
	}

	return a ;
}
void DoInput( void )
{
	char in[2][30+1] ;
	int n[2] , i , j , k ;
	
	gets( in[0] ) ;
	gets( in[1] ) ;

	for( i=0 ; i<2 ; ++i )
		for( n[i]=0,j=0,k=strlen( in[i] )-1 ; k>=0 ; ++j,--k )
			if( in[i][k]-'0' ) n[i] += mypow[j] ;
	
	if( GCD( n[0] , n[1] )==1 ) puts( "Love is not all you need!" ) ;
	else puts( "All you need is love!" ) ;
}
int main( void )
{
	int time , n ;
	
	MakeMypow() ;
	
	scanf( "%d\n" , &n ) ;
	for( time=1 ; time<=n ; ++time ){
		printf( "Pair #%d: " , time ) ;
		DoInput() ;
	}

	return 0 ;
}
/* @END_OF_SOURCE_CODE */

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