描述
Please calculate the coefficient modulo 2 of x^i in (1+x)^n.
输入
For each case, there are two integers n, i (0<=i<=n<=2^31-1)
输出
For each case, print the coefficient modulo 2 of x^i in (1+x)^n on a single line.
样例输入
3 1
4 2
样例输出
1
0
#include<stdio.h>
int main()
{
int n,i;
while(scanf("%d %d",&n,&i)!=EOF)
{
if((n&i)==i)//这里&是按位与运算符
printf("1\n");
else
printf("0\n");
}
return 0;
}