PersonalCorpus 版 (精华区)

1233798 Big Guava ... 10006 Accepted
0:00.180 392 2002/11/13 08:30:07.912

bool is_CarmichaelNumber(int n)
{

    int t[]={561,1105,1729,2465,2821,6601,8911,10585,15841,29341,
            41041,46657,52633,62745,63973,0};
    int i;
    for (i=0;t[i];i++) if (n==t[i]) return true;
    return false;
}


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

    int i,j,k,t,n;

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