C++字符串判等
#include <iostream>
#include <cstring>
using namespace std;
int main(){
char a,b,c,d;
cin.getline(a,101);
cin.getline(b,101);
int k=0;
for(int i=0;i<strlen(a);i++){
if(a!=' '){
if(a>='a'&&a<='z') c=a-32;
else c=a;
}
}
int h=0;
for(int i=0;i<strlen(b);i++){
if(b!=' '){
if(b>='a'&&b<='z') d=b-32;
else d=b;
}
}
if(strcmp(c,d)) cout<<"NO"<<endl;
else cout<<"YES"<<endl;
return 0;
}
https://blog.51cto.com/u_15467636/4864096
页:
[1]