1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 5 int N; 6 int i; 7 int side[300]; 8 int main() 9 { 10 while(cin >> N) 11 { 12 int sum = 0; 13 if(N == 0) return 0; 14 else 15 { 16 for(i = 0;i < N;i++) 17 { 18 cin >> side[i]; 19 sum = side[i] * side[i] +sum; 20 } 21 cout << sum <<endl; 22 } 23 } 24 return 0; 25 }
HDU 4450 Draw Something,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/zzy9669/p/3855043.html