PersonalCorpus 版 (精华区)

1233850 Big Guava ... 10007 Accepted
0:00.002 64 2002/11/13 09:13:07.678

#include "longinteger.c"


void main()
{
#ifndef ONLINE_JUDGE
    freopen("k:\\uva\\i10007","r",stdin);
    freopen("k:\\uva\\o10007","w",stdout);
#endif

    int i,j,k,t,n;
    struct longinteger c[33], temp;

    setoneLI(&c[0]);
    setoneLI(&c[1]);
    for (i=2;i<33;i++) {
        setzeroLI(&c[i]);
        for (j=0;j<i;j++) {
            setzeroLI(&temp);
            mulLL3(&temp,&c[j],&c[i-j-1]);
            addLI2(&c[i],&temp);
        }
    }
    setoneLI(&temp);
    for (i=2;i<33;i++) {
        mulLI2(&temp,i);
        mulLL2(&c[i],&temp);
    }

    while (1) {
        scanf("%d\n",&n);
        if (n==0) break;
        printLI(&c[n]);
        printf("\n");
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.244毫秒