写一个java程序求两数之和
时间: 2023-03-16 07:43:54 浏览: 116
答:import java.util.Scanner;public class SumTwo {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入两个数字:");
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println("两数之和为:" + (a + b));
}
}
阅读全文