PersonalCorpus 版 (精华区)

1139981 Big Guava ... 10334 Accepted
0:00.040 624 2002/10/03 06:37:01.340


void main()
{
#ifndef ONLINE_JUDGE
    freopen("c:\\0acm\\uva\\i10334","r",stdin);
    freopen("c:\\0acm\\uva\\o10334","w",stdout);
#endif

    int i;
    struct longinteger a[4],s[1001];

    setzeroLI(&a[0]);
    setoneLI(&a[1]);
    setzeroLI(&a[2]);
    setoneLI(&a[3]);

    setoneLI(&s[0]);
    addLI3(&s[1],&a[1],&a[3]);
    for (i=2;i<1001;i++)
        if (i%2==0) {
            addLI3(&a[0],&a[1],&a[3]);
            copyLI(&a[2],&a[3]);
            addLI3(&s[i],&a[0],&a[2]);
        } else {
            addLI3(&a[3],&a[0],&a[2]);
            copyLI(&a[1],&a[0]);
            addLI3(&s[i],&a[1],&a[3]);
        }
    while (scanf("%d\n",&i)==1) {
        printLI(&s[i]); printf("\n");
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.179毫秒