The second the first
2023-12-24 19:39:21
发布于:广东
191阅读
0回复
0点赞
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <string.h>
using namespace std;
int main(){
string s1, s2;
int i;
getline(cin, s1);
getline(cin, s2);
int len1 = s1.length();
int len2 = s2.length();
for(int i = 0; i < len1; i++){
if(isupper(s1[i])){
s1[i] += 32;
}
}
for(int i = 0; i < len2; i++){
if(isupper(s2[i])){
s2[i] += 32;
}
}
int ans1 = 0, ans2 = 0;
for(int i = 0; i < len1; i++){
if(s1[i] != ' '){
ans1 += int(s1[i]);
}
}
for(int i = 0; i < len2; i++){
if(s2[i] != ' '){
ans2 += int(s2[i]);
}
}
if(ans1 == ans2){
cout << "YES";
}else{
cout << "NO";
}
return 0;
}
这里空空如也
有帮助,赞一个