package mytest1;
import java.io.*;
class MyTest1
{
public static void main(String[] args)throws IOException
{
//System.out.println("Hello World!");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String input=null;
while((input=br.readLine())!=null)
{
getBiaoZhi(input);
}
}
public static void getBiaoZhi(String input)
{
int sum=0;
String[] arr=input.split("-");
//额这里偷点懒,那个因为题目说有三个“-”那这个arr的长度就是为四的,我就不用arr.length了
String b=arr[0]+arr[1]+arr[2]+arr[3];
System.out.println(b);
byte[] brr=b.getBytes();
//System.out.println(brr);
for(int x=0;x<brr.length-1;x++)
{
//System.out.println(brr[x]);
sum=sum+((brr[x]-'0')*(x+1));
}
//System.out.println(sum);
if((sum%11)==brr[brr.length-1])
System.out.println("Rright");
else
System.out.println(sum%11);
}
} |
|