0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-18 11:11:59 +00:00
OI-codes/Luogu/P1055/P1055.cpp
2021-11-21 15:28:42 +08:00

25 lines
406 B
C++

#include <bits/stdc++.h>
using namespace std;
const char mod[] = "0123456789X";
int t;
string s;
int main() {
cin >> s;
for (int i = 0, j = 0; i < 12; i++) {
if (s[i] != '-') {
t += (s[i] - '0') * ++j;
}
}
if (s[12] != mod[t % 11]) {
s[12] = mod[t % 11];
cout << s << endl;
} else {
cout << "Right" << endl;
}
return 0;
}