Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 135986 Accepted Submission(s): 41510
1 #include <iostream> 2 using namespace std; 3 int main() { 4 int test; 5 int a, b; 6 cin >> test; 7 8 while(test--) 9 { 10 int sum = 0; 11 int temp, n; 12 cin >> n; 13 for(int i = 0; i < n; i++) 14 { 15 cin >> temp; 16 sum += temp; 17 } 18 if(test != 0) 19 cout << sum << endl << endl; 20 else 21 cout << sum << endl; 22 } 23 24 return 0; 25 }
hdu 1096 A+B for Input-Output Practice (VIII)
原文:http://www.cnblogs.com/qinduanyinghua/p/5518216.html