[求助]要怎样才不溢出啊?
int main()
{
long n, k, i=0, t=0, j=0, p=1, q=1, s=1;
scanf("%ld%ld", &n, &k);
while(n!=0)
{
while(i<n)
{
p*=(i+1);
i++;
}
while(j<n-k)
{
q*=(j+1);
j++;
}
while(t<k)
{
s*=(t+1);
t++;
}
printf("%ld\n", p/(q*s));
scanf("%ld%ld", &n, &k);
}
return 0;
}
while语句可以改成for语句吗?要怎样改啊?谢谢了!