点击前往试题目录:https://blog.csdn.net/best335/article/details/99550556
#include<iostream>
#include<cstring>
using namespace std;
int main(){
string s;
cin>>s;
int check=0,n=s.size(),ni=n-1;
for(int i=0,j=1;i<ni;++i){
if(s[i]=='-')continue;
check+=(s[i]-'0')*j;
++j;
}
if(s[ni]=='X'||s[ni]=='x') s[ni]='0'+10;
if(check%11!=(s[ni]-'0')){
if(check%11==10)
cout<<s.substr(0,ni)<<"X"<<endl;
else
cout<<s.substr(0,ni)<<check%11<<endl;
}
else{
cout<<"Right"<<endl;
}
return 0;
}