Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
40501 lnx 字符串判等 C++ 解答错误 0 MS 248 KB 568 2024-02-11 18:18:31

Tests(0/1):


#include<bits/stdc++.h> using namespace std; int main() { char a[100],b[100],c[100],d[100]; gets(a); gets(b); int lena=strlen(a); int lenb=strlen(b); int m=0,n=0; for(int i=0;i<strlen(a);i++){ if(a[i]!=' '){ c[m]=a[i]; if(c[m]<='Z') c[m]=(char)((int)c[m]+32); m++; } } for(int i=0;i<strlen(b);i++){ if(b[i]!=' '){ d[n]=b[i]; if(d[n]<='Z') d[n]=(char)((int)d[n]+32); n++; } } c[m]='\0'; d[n]='\0'; cout<<c<<'\n'<<d; if(strcmp(c,d)==0){ cout<<"YES"; } else cout<<"NO"; return 0; }


测评信息: