PersonalCorpus 版 (精华区)

1140062 Big Guava ... 10338 Accepted
0:00.580 408 2002/10/03 07:16:24.958


void main()
{
#ifndef ONLINE_JUDGE
    freopen("c:\\0acm\\uva\\i10338","r",stdin);
    freopen("c:\\0acm\\uva\\o10338","w",stdout);
#endif
    struct longinteger r;
    int i,j,k,n,t;
    char s[100];
    int ch[26];

    scanf("%d\n",&n);
    for (t=1;t<=n;t++) {
        printf("Data set %d: ",t);
        gets(s);
        memset(ch,0,sizeof(ch));
        for (i=0;s[i]!=0;i++) ch[s[i]-65]++;
        setoneLI(&r);
        for (i=2;i<=strlen(s);i++) mulLI2(&r,i);
        for (i=0;i<26;i++) while (ch[i]>1) { divLI2(&r,ch[i],k); 
ch[i]--; }
        printLI(&r); printf("\n");
    }
}
    
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:14.247毫秒