logo AlgoBeat OnlineJudge
登录 注册

题解

作者: tyxx040105  ·  发布于 2026-07-21 14:54:54  ·  最后修改于 2026-07-21 17:36:42
已通过
审核员:joe_zxq 彩笔 · 2026-07-21 17:36:42

水,直接模拟。

#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;
}

暂无评论

登录 后即可评论。