281 条题解
-
-15661lhr LV 8 @ 2016-11-28 03:44:55
#include <iostream> #include <cstdlib> #include <cstdio> #include <climits> #include <cmath> #include <algorithm> #include <functional> #include <iterator> #include <cstring> #include <set> #include <vector> #include <queue> #include <list> #include <cctype> #include <string> using namespace std; int main() { string s; cin>>s; int tt=(s[0]-'0')*1+(s[2]-'0')*2+(s[3]-'0')*3+(s[4]-'0')*4+(s[6]-'0')*5+ (s[7]-'0')*6+(s[8]-'0')*7+(s[9]-'0')*8+(s[10]-'0')*9; tt=tt%11; if(tt==s[12]-'0'){cout<<"Right";} else if(tt==10) { if(s[12]=='X'){cout<<"Right";} else{s[12]='X';cout<<s;} } else{s[12]=48+tt;cout<<s;} return 0; }