解题思路:
注意事项:
参考代码:
import java.util.Scanner;
/**************题目 1090: A+B for Input-Output Practice (VI)**********************/
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = 2 ; // n组数据
int[] array = new int[2];
for (int i = 0; i < 2 ; i++) {
int sum = 0;
int x = sc.nextInt(); // 每组数据多少个
for (int j = 0; j < x ; j++) {
int a = sc.nextInt();
sum+=a;
}
array[i] = sum;
}
for (int i = 0; i < 2; i++) {
System.out.println(array[i]);
}
}
}
0.0分
0 人评分