解决此题有几大关键之处,首先,要灵活运用将字符转换成整型,方便进行数值的运算,其次要考虑识别码为“X”的情况,我们可以通过特定的代码实现与前面数乘积之和求余的比较,来判定识别码是否为“X”的情况,若比较成功,则输出Right,不成功则输出正确的码,若有“X”情况则在识别码写“X”,即可解决此题

import java.util.*; public class Main {

public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String str=sc.next();
char[] c=new char[13];
for(int i=0;i<str.length();i++) {
	c[i]=str.charAt(i);
}
int c1=Integer.parseInt(Character.toString(c[0]));
int c2=Integer.parseInt(Character.toString(c[2]));
int c3=Integer.parseInt(Character.toString(c[3]));
int c4=Integer.parseInt(Character.toString(c[4]));
int c5=Integer.parseInt(Character.toString(c[6]));
int c6=Integer.parseInt(Character.toString(c[7]));
int c7=Integer.parseInt(Character.toString(c[8]));
int c8=Integer.parseInt(Character.toString(c[9]));
int c9=Integer.parseInt(Character.toString(c[10]));
int ccc;
if(c[12]=='X') {
	 ccc=999;
}
else {
	 ccc=Integer.parseInt(Character.toString(c[12]));
}


int a=(c1+c2*2+c3*3+c4*4+c5*5+c6*6+c7*7+c8*8+c9*9)%11;
if(a==10) {
	a=999;
}
int b=ccc;
if(a==b) {
	System.out.println("Right");
}
else {
	if(a==999) {
		System.out.println(str.substring(0,12)+"X");
	}
	else {
		System.out.println(str.substring(0,12)+a);
	}
	
}

}

}