解题思路:
注意事项:
参考代码:
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Scanner; import javax.swing.Box; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] arr1 = new int[n];int[] arr2 = new int[n]; for (int i = 0; i < n; i++) { arr1[i] = scanner.nextInt(); arr2[i] = scanner.nextInt(); } int sum1=0,sum2=0; for (int i = 0; i < n; i++) { sum1 += arr1[i]; sum2 += arr2[i]; } System.out.println(sum1+"+"+sum2+"i"); } }
0.0分
4 人评分