import java.util.Scanner;
public class test {
public static void main(String[] args) {
int a, b;
Scanner reader = new Scanner(System.in);
while(reader.hasNext()){
a = reader.nextInt();
b = reader.nextInt();
System.out.println(a+b);
}
reader.close();
}
}
public class test {
public static void main(String[] args) {
int a, b;
Scanner reader = new Scanner(System.in);
while(reader.hasNext()){
a = reader.nextInt();
b = reader.nextInt();
System.out.println(a+b);
}
reader.close();
}
}
本文介绍了一个简单的Java程序,该程序通过控制台接收两个整数作为输入,并输出这两个整数的和。使用了Scanner类来读取用户的输入。
5316

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



