JavaDay01.练习1.键盘输入两个int数字,并且求出和值
import java.util.Scanner;
/**
* 练习1 题目:
* 键盘输入两个int数字,并且求出和值
*/
public class T1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("请您输入第一个数字:");
int num1 = scanner.nextInt();
System.out.println("请您输入第二个数字:");
int num2 = scanner.nextInt();
int result = num1 + num2;
System.out.println(num1 + " + " + num2 + " = " + result);
}
}