#include<iostream> using namespace std; int main() { int n, i, j; long long int s = 0; //用long long cin >> n; int* a = new int[n]; for (i = 0;i < n;i++) { cin >> a[i]; } for (i = 0;i < n-1;i++) //n-1 { for (j = i+1;j < n;j++) { s += a[i] * a[j]; } } cout << s; delete[]a; return 0; }
0.0分
0 人评分