#include <stdio.h>
#include <stdlib.h>
int main() {
long long int n=0;
long long int i,j;
long long int k,l;
char a[n];
while(scanf("%d",&n)!=EOF){
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
l=0;
for(i=0;i<n;i++){
k=0;
for(j=i+1;j<n;j++){
k=k+a[j];
}
l=l+a[i]*k;
}
printf("%d",l);
}
return 0;
}
系統呼叫了 abort 函式! *** stack smashing detected ***: terminated Aborted (core dumped)