1 #include<iostream>
2 using namespace std;
3 #define maxn 100000+5
4 int n, ans,flag;
5 int sum,lsum, rsum;
6 int arr[maxn];
7 int judge(int m)
8 {
9 lsum = 0, rsum = 0;
10 for (int i = 0; i <m; i++)
11 {
12 if (sum == 0)
13 {
14 if (i == m - 1) //防止总和为零的时候再计算一次
15 break;
16 }
17 lsum += arr[i]; //左边的数的和
18 rsum = sum - lsum; //右边的数的和
19 if (lsum == rsum) //相等就加加
20 ans++;
21 }
22 if (ans)
23 {
24 flag = 1;
25 return flag;
26 }
27 else
28 return 0;
29 }
30 int main()
31 {
32 sum = 0,flag=0,ans=0;
33 cin >> n;
34 for (int i = 0; i < n; i++)
35 {
36 cin >> arr[i];
37 sum += arr[i];
38 }
39 if (sum % 2 != 0)
40 flag = 0; //总和为奇数,直接判断不可以分成相等的两半
41 else
42 judge(n);
43 if (flag == 1)
44 cout <<ans << endl;
45 else
46 cout << "0" << endl;
47
48 return 0;
49 }