import java.util.Scanner;
public class xiangliang {
public static void main(String[] args) {
int a[] = new int[1000];
int b[] = new int[1000];
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int x = 0;
int i = 0;
int f = 0;
for (; i < n && f < n; i++, f++) {
a[i] = scan.nextInt();
b[f] = scan.nextInt();
x = x + a[i] * b[f];
}
System.out.println(x);
}
}
向量点积计算
最新推荐文章于 2024-08-12 15:45:48 发布