为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

#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;}
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 1133 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信