0 a+b
import java.util.*;
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);
}
}
}
收获:while (sc.hasNextInt())
可以输入多行数据,题目说的不是很清楚。