#include <cstdio> #include <iostream> using namespace std; int main() { int c,a=0; string s=""; for (int i=1;i<=9;++i) { c=getchar(); s+=c; if (c=='-') --i; //序号指数字的序号,连字符不算 else if (c!='-') a=(a+(c-'0')*i)%11; } getchar(); c=getchar(); if ((a==10 && c=='X') || a+'0'==c) { //读入特判 cout<<"Right"; return 0; } cout<<s<<'-'; if (a==10) cout<<'X'; //输出特判 else cout<<a; return 0; }
3
31
2015
31
2015