import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()) {
int a=sc.nextInt();
int b=sc.nextInt();
System.out.println(a+b);
}
}
}HDOJ 1000 JAVA
最新推荐文章于 2021-07-26 17:37:33 发布
本文介绍了一个简单的Java程序,该程序使用Scanner类从控制台读取两个整数并输出它们的和。通过while循环实现连续输入计算的功能。
582

被折叠的 条评论
为什么被折叠?



