#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
freopen("test.in", "r", stdin);
freopen("test.out", "w", stdout);
string str;
while (cin>>str)
{
int sum = 0, start = 0;
for (int i = 1; i <= 9; i++)
{
if (str[start] == '-')
start++;
sum += i * (str[start] - '0');
start++;
}
sum %= 11;
if (sum == 10)
sum = 'X';
else
sum += '0';
if (sum == str[str.length() - 1])
cout << "Right" << endl;
else
{
str[str.length() - 1] = sum;
cout << str << endl;
}
}
}
为啥输入的时候用cin可以AC,用getline就不行?