kmhgk @ 2022-08-16 17:23:32
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
string s;
cin>>s;
int n=s.size();
int ans=0;
int a[10086]={};
int j=1;
for(int i=0;i<=n;i++){
if(s[i]>=48&&s[i]<=57){
ans=ans+(s[i]-'0')*j;
j++;
}
}
ans=ans%11;
if(ans==s[n]||((s[n]=='X')&&ans==10)){
cout<<"Right";
}else{
for(int i=0;i<=n-2;i++){
cout<<s[i];
}
if(ans==10){
cout<<'X';
}else{
cout<<ans;
}
}
return 0;
}
by kmhgk @ 2022-08-16 17:24:41
除了第一个,第二个,第十个其他全WA了
by Re_Star @ 2022-08-16 18:00:47
开long long