PersonalCorpus 版 (精华区)

1044840 Big Guava ... 454 Accepted 0:00.020
64 2002/08/27 10:24:38.910

int mycmp(const void * a, const void * b)
{
    return strcmp((char *)a,(char *) b);
}

void main()
{
    char s[100][1000];
    int sum[100][130],i,j,k,n;

    scanf("%d\n",&n);
    while (n>0) {
        n--;
        k=0;
        while (gets(s[k])!=NULL) if (strlen(s[k])==0) break; else k++;
        qsort(s,k,1000,mycmp);
        memset(sum,0,sizeof(sum));
        for (i=0;i<k;i++) {
            j=0; while (s[i][j]!=0) { sum[i][s[i][j]]++; j++; }
            sum[i][32]=0;
        }
        for (i=0;i<k-1;i++) for (j=i+1;j<k;j++)
            if (memcmp(sum[i],sum[j],520)==0) printf("%s = %s\n",s[i],
s[j]);
        printf("\n");
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:1.875毫秒