var
s:string;
i,j,ans:integer;
a:array[1..10] of integer;
begin
readln(s);
i:=0;
j:=1;
while i<9 do
begin
if (s[j]>='0')and(s[j]<='9') then
begin
inc(i);
ans:=ans+(ord(s[j])-ord('0'))*i;
end;
inc(j);
end;
ans:=ans mod 11;
if ((ans=10)and(s[length(s)]='X'))or(ans=ord(s[length(s)])-ord('0')) then
writeln('Right')
else if ans=10 then
writeln(copy(s,1,length(s)-1),'X')
else
writeln(copy(s,1,length(s)-1),ans);
end.
C++
#include
main()
{
int i,j,s;
char a[13];
j=1; s=0;
for (i=0;i<12;i++)
{
scanf("%c",&a[i]);
if (a[i]!='-')
{
s=s+(a[i]-48)*j;
j++;
}
}
s=s%11;
scanf("%c",&a[12]);
if (s==a[12]-48) printf("Right");
else if ((s==10)&&(a[12]=='X')) printf("Right");
else {
for (i=0;i<12;i++) printf("%c",a[i]);
if (s==10) printf("X");
else printf("%d",s);
}
getchar();
getchar();
return(0);
}
PASCAL:
var s,st:string;
i,n,j,js,k:longint;
begin
readln(s);
st:=s;
j:=0;
while j
j:=j+1;
if s[j]='-' then
delete(s,j,1);
end;
for i:=1 to 9 do
begin
js:=js+i*(ord(s[i])-48);
end;
js:=js mod 11;
k:=ord(s[10])-48;
if s[10]='X' then k:=10;
if k=js then writeln('Right')
else begin
for i:=1 to 12 do write(st[i]);
if js<>10 then
writeln(js)
else writeln('X');
end;
end.