计蒜客 情人节表白
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\n",sum); 16 17 } 18 return 0; 19 20 }