View Code of Problem 610

#include <stdio.h>

long c(long n)
{
	long sum=1,temp;
	for(int i=1;i<=2*n;i++)
	{
		sum*=i;
		if(i==n)
		{
			temp=sum;
		}
	}
	return sum/(temp*temp)/(n+1);
}




int main()
{
	long n;
	while(scanf("%ld",&n)!=EOF)
	{
		long m;
		m=c(n);
		printf("%ld\n",m);
	}
 } 

Double click to view unformatted code.


Back to problem 610