#include <iostream>
#include <string>
using namespace std ;
string isbn ;
inline short turn_int ( char c ) {
return int(c-'0') ;
}
int main () {
cin >> isbn ;
int n ;
for ( int i = 0 , j = 1 ; i <= 10 ; i ++ , j ++ ) {
if ( isbn[i] == '-' ) j -- ;
else n += turn_int( isbn[i] )*j ;
}
if ( n%11 == turn_int(isbn[12]) || ( n%11==10 && isbn[12]=='X' ) ) cout << "Right" ;
else {
if ( n%11 != 10 ) isbn[12] = char ( n%11+'0' ) ;
else isbn[12] == 'X' ;
cout << isbn ;
}
return 0 ;
}
C++14运行无误,与下载的测试点一致