Follows 530.c (Total 20 lines):

/* @JUDGE_ID:4461XX 530 C */
/* A */
#include <stdio.h>
void main( void )
{
	unsigned long m , n , ans ;
	while( scanf( "%lu %lu" , &m , &n )==2 )
	{
		unsigned long i , j ; double total=1 ;
		if( m==0 && n==0 ) break ;
		if( m - n<n ) n = m - n ;
		for( i=m , j=(unsigned long)1 ; j<=n ; i-- && j++ )
		{
			total *= (double)i ;
			total /= (double)j ;
		}
		ans = (unsigned long)total ;
		printf( "%lu\n" , ans ) ;
	}
}

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