水,直接模拟。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int q,w,e,r,t,y,u,i,o,a,s;
char d;
scanf("%1d-%1d%1d%1d-%1d%1d%1d%1d%1d-%c",&q,&w,&e,&r,&t,&y,&u,&i,&o,&d);
a=(q*1+w*2+e*3+r*4+t*5+y*6+u*7+i*8+o*9)%11;
if(d=='X')
s=10;
else
s=d-'0';
if(a==s)
cout<<"Right";
else if(a==10)
cout<<q<<"-"<<w<<e<<r<<"-"<<t<<y<<u<<i<<o<<"-X";
else
cout<<q<<"-"<<w<<e<<r<<"-"<<t<<y<<u<<i<<o<<"-"<<a;
return 0;
}
暂无评论