1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int main() 5 { 6 7 int n; 8 while(scanf("%d",&n),n){ 9 int x,sum=0; 10 for(int i=0;i<n;++i) 11 { 12 scanf("%d",&x); 13 sum+=x*x; 14 } 15 printf("%d ",sum); 16 17 } 18 return 0; 19 20 }