题解
2023-07-07 13:07:06
发布于:上海
39阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
map<char,int> m;
int main(){
char a,b,c;
cin>>a>>b>>c;
int sum = 0,a1=0,a2=0,a3=0;
if(a>='a' and a<='z'){
sum+=26-('z'-a);
a1=26-('z'-a);
}else{
sum+=26-('Z'-a);
a1=26-('Z'-a);
}
if(b>='a' and b<='z'){
sum+=26-('z'-b);
a2=26-('z'-b);
}else{
sum+=26-('Z'-b);
a2=26-('Z'-b);
}
if(c>='a' and c<='z'){
sum+=26-('z'-c);
a3=26-('z'-c);
}else{
sum+=26-('Z'-c);
a3=26-('Z'-c);
}
cout<<sum<<" ";
if(a1>a2 and a1>a3){
if(a>='A' and a<='Z') a+=32;
cout<<a;
}
else if(a2>a1 and a2>a3){
if(b>='A' and b<='Z') b+=32;
cout<<b;
}
else if(a3>a2 and a3>a1){
if(c>='A' and c<='Z') c+=32;
cout<<c;
}
return 0;
}
这里空空如也
有帮助,赞一个