1、A+B(1)
输入包括两个正整数a,b(1 <= a, b <= 10^9),输入数据包括多组。输出a+b的结果
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();
if (a>=1 && b<=Math.pow(10,9)){
System.out.println(a+b);
}
}
}
}
2、A+B(2)
输入第一行包括一个数据组数t(1 <= t <= 100),接下来每行包括两个正整数a,b(1 <= a, b <= 10^9)。
输出a+b的结果。
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while (sc.hasNextInt