问题描述
![在这里插入图片描述](https://img-blog.csdnimg.cn/20201107194921403.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQ1NDM4NjAw,size_16,color_FFFFFF,t_70#pic_center)
代码
#include<iostream>
#include<cstring>
using namespace std;
int main(){
string s;
cin>>s;
int a[10];
int q=1;
for(int i=0;i<13;i++){
if(i==1 || i==5 || i==11){
}
else{
a[q] = s[i]-'0';
q++;
}
}
int identification = 0;
for(int i=1;i<10;i++){
identification += a[i]*i;
}
identification %= 11;
if(identification == a[10] || (identification == 10 && s[12]=='X')) cout<<"Right";
else {
for(int i=0;i<13;i++){
if(i == 12) {
if(identification == 10) cout<<"X";
else{
identification = char(identification);
cout<<identification;
}
}
else cout<<s[i];
}
}
return 0;
}