PersonalCorpus 版 (精华区)

1044080 Big Guava ... 455 Accepted 0:00.000
64 2002/08/27 04:34:06.817

void main()
{
    char s[100];
    int i,j,k,m;
    bool ok;

    scanf("%d\n",&k);
    while (k>0) {
        k--; ok=false;
        gets(s);
        j=strlen(s);
        for (i=1;i<=j/2;i++) if (j%i==0) {
            for (m=1;m<j/i;m++) if (memcmp(s,s+m*i,i)!=0) break;
            if (m==j/i) { printf("%d\n",i); ok=true; break; }
        }
        if (!ok) printf("%d\n",j);
        gets(s);
//        if (k>0) printf("\n");
        printf("\n");
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:10.621毫秒