start:java8

This commit is contained in:
dichgrem
2025-10-30 14:30:50 +08:00
parent 3d166ec578
commit af1ea3e24e
21 changed files with 303 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package com.study.demo;
import java.util.Scanner;
public class test3_2 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int[] a = new int[n];
int[] b = new int[n];
for (int i = 0; i < n; i++) {
a[i] = scanner.nextInt();
}
for (int i = 0; i < n; i++) {
b[i] = scanner.nextInt();
}
int sum = 0;
for (int i = 0; i < n; i++) {
sum += a[i] * b[i];
}
System.out.println(sum);
}
}