//1. 导包
import java.util.Scanner;
public class ScannerTest{
public static void main(String[] args){
//2.创建对象
Scanner sc = new Scanner(System.in);
//3.接受数据
int number1= sc.nextInt();
int number2 = sc.nextInt();
System.out.println(number1+number2);
}
格式化代码,idea中ctrl + Alt + L ,