在已定义的字符串数组中寻早,为什么会编译过不了

#include<cstdio>

#include<string>

#include<algorithm>

using namespace std;

//const char* c[]={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,S,Y,Z};

const char c[26]="ABCDEFGHIJKLMNOPQRSTUVWSYZ";

int main(void)

{ char a[200],b[200];

    while(scanf("%s",a)!=EOF)

    {int over=0,m;

        scanf("%s",b);

        m=sizeof(a);

        sort(a,a+m);

        sort(b,b+m);

        int *p=lower_bound(c,c+26,a[0]);

        int *d=lower_bound(c,c+26,b[0]);

       int pd=*p-*d;


        while(--m)

        {*p=lower_bound(c,c+26,a[m]);

        *d=lower_bound(c,c+26,b[m]);

        int qd=*p-*d;

            if(qd!=pd){over=1;break;}}

        if(over)printf("NO\n");

        else printf("YES\n");

    }

    return 0;

}


慕用7336610
浏览 1134回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP