#include<iostream>
#include<string>
using namespace std;
int main() {
string n;
cin >> n;
int num[100];
int q = 0;
string::iterator s;
for (s = n.begin(); s != n.end()-1; s++) {
if (*s != '-') {
num[q] = *s; q++;
}
}
int sum = 0;
for (int i = 0; i < n.length()-3; i++) {
sum += num[i] * i;
}
int check = sum % 11;
if (check == 10) check = 'X';
//cout << (check==*(n.end() - 1)-'0') << endl;
if (check == *(n.end()-1)-'0') cout << "Right";
else {
string::iterator s1;
for (s1 = n.begin(); s1 != n.end()-1; s1++) {cout<<*s1; }
cout << check;
}
return 0;
}
ccf 201312-2 ISBN号码,水题,考前增强信心
最新推荐文章于 2025-04-11 21:34:50 发布