//进入到键盘录入Scanner这个包
import java.util.Scanner;
//求一个整数个十百千位上的数字
public class ScannerTest {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入一个四位数1524");
//电脑记录键盘录入的数字
int number1 = sc.nextInt();//int对应nextInt(),String对应nextString()
int ge = number1 % 10;
int shi = number1 / 10 % 10;
int bai = number1 / 100 % 10;
int qian = number1 / 100 % 10;
System.out.println("个位数是" + "number1 % 10");//个位数是number1 % 10
System.out.println("十位数是" + "shi");//十位数是shi,加了双引号就是字符串
System.out.println("百位数是" + bai);//百位数是5(正确写法)
System.out.println("千位数是" + number1 / 100 % 10);//千位数是5(正确写法)
}
}