package org.niit.pojo;
public class yz
{
static int yu,sum=0;
static String end,test,id;
static int[] a=new int[18];
static int[] b={7, 9 ,10 ,5 ,8 ,4 ,2, 1 ,6 ,3 ,7 ,9 ,10, 5 ,8 ,4, 2 };
public static void main(String[] args)
{
id=args[0];
if(id.length()==18)
{for(int i=0;i<id.length()-1;i++)
{a[i]=Integer.parseInt(id.substring(i, i+1));
sum=sum+a[i]*b[i];
}
System.out.println(sum);
yu=sum%11;
switch(yu)
{
case 0: test="1";break;
case 1: test="0";break;
case 2: test="x";break;
case 3: test="9";break;
case 4: test="8";break;
case 5: test="7";break;
case 6: test="6";break;
case 7: test="5";break;
case 8: test="4";break;
case 9: test="3";break;
case 10: test="2";break;
}
end=id.substring(17, 18);
if(test.compareTo(end)==0)
{System.out.println("你的身份证是真的");
}
else
System.out.println("你的身份证是假的");
System.out.println(end);
}
else
System.out.println("你的身份证位数不是18位,肯定是假的");
}
}