- ISBN号码
- 2024-11-26 22:49:04 @
#include<iostream>
#define int long long
using namespace std;
string s;
int mod=11,sum,k;
int strint(string a){
int temp=0,cnt=0,g=1;
for(int i=0;i<=a.size()-3;i++){
if(a[i]>='0'&&a[i]<='9'){
temp+=(a[i]-'0')*g;
g++;
}
}
return temp%mod;
}
signed main()
{
cin>>s;
sum=strint(s);
int len=s.length()-1;
k=s[len]-'0';
if(k==sum){
cout<<"Right";
}
else{
for(int i=0;i<=s.size()-2;i++){
cout<<s[i];
}
cout<<sum;
}
}
0 条评论
目前还没有评论...