201312-2 ISBN号码
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
string s;
int main() {
cin >> s;
int num = 0;
for (int i = 0, p = 1; i < s.size() - 1; ++i)
if (s[i] != '-') {
num += (s[i] - '0') * p;
p++;
}
num %= 11;
char res;
if (num == 10) res = 'X';
else res = num + '0';
if (res == s.back()) printf("Right\n");
else {
s = s.substr(0, s.size() - 1);
s.push_back(res);
cout << s << endl;
}
return 0;
}