1.导包
import java.util.Scanner;
2.创建对象
Scanner sc = new Scanner(System.in);
3.接收数据
int i = sc.nextInt();