int a = 1234;
int ge, shi, bai, qian;
int lastOne, lastTwo, lastThree;
ge = (a / 1) % 10;
shi = (a / 10) % 10;
bai = (a / 100) % 10;
qian = (a / 1000) % 10;
lastOne = a % 10;
lastTwo = a % 100;
lastThree = a % 1000;
System.out.println("个位" + ge);
System.out.println("十位" + shi);
System.out.println("百位" + bai);
System.out.println("千位" + qian);
System.out.println("*************************");
System.out.println("最后一位" + lastOne);
System.out.println("最后两位" + lastTwo);
System.out.println("最后三位" + lastThree);
