HDU2519

Here Insert Picture Description

The number of combinations of words to about 23 really going to blow longlong
which use large numbers of? ?
I do not choose violence followed
by double
really wa several times
but a finally
double is off

printf% .0lf control output also right
not behind the decimal point

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	int a,b;
	scanf("%d",&t);
	while(t--)
	{
		double m=1,n=1;
		scanf("%d%d",&a,&b);
		if(a<b)
			cout<<0<<endl;
		else if(a==b)
			cout<<1<<endl;
		else
		{
			for(int i=1;i<=b;i++,a--)
		{
			m*=a;
			n*=i;
		}
		printf("%.0lf\n", m / n);
		}

	}
	return 0;
}
Published 54 original articles · won praise 4 · Views 877

Guess you like

Origin blog.csdn.net/weixin_45460987/article/details/103466236