user-0 提问: 各位大佬，实在是做不出来，求各位大佬指导

回复:
user: user-0
content: 引用 2 楼 user-1的回复:无比暴力，仅供参考： #include <stdio.h> #define MAXLEN 1024  int handler(int data[], int status[], int n, int len) {     int value1, value2, ret, i;      if (n < len-1)     {         status[n] = 0;         ret = handler(data, status, n + 1, len);         if (ret) return ret;          status[n] = 1;         ret = handler(data, status, n + 1, len);         if (ret) return ret;     }      status[n] = 0;     value1 = value2 = 0;     for (i = 0; i < len; i++)     {         if (status[i] == 0) value1 = value1 + data[i];         else value2 = value2 + data[i];     }     if (value1 == value2) return value1;      status[n] = 1;     value1 = value2 = 0;     for (i = 0; i < len; i++)     {         if (status[i] == 0) value1 = value1 + data[i];         else value2 = value2 + data[i];     }     if (value1 == value2) return value1;      return 0; }  int main(void) {     int data[MAXLEN], status[MAXLEN];     int d, ret, len = 0;      while(1)     {         scanf("%d", &d);         if (d == -1) break;         data[len++] = d;     }      ret = handler(data, status, 0, len);      if (ret > 0) printf("Yes\n%d\n", ret);     else printf("No\n");      return 0; }  谢谢你，谢谢你😊

user: user-0
content: 引用 2 楼 user-1的回复:无比暴力，仅供参考： #include <stdio.h> #define MAXLEN 1024  int handler(int data[], int status[], int n, int len) {     int value1, value2, ret, i;      if (n < len-1)     {         status[n] = 0;         ret = handler(data, status, n + 1, len);         if (ret) return ret;          status[n] = 1;         ret = handler(data, status, n + 1, len);         if (ret) return ret;     }      status[n] = 0;     value1 = value2 = 0;     for (i = 0; i < len; i++)     {         if (status[i] == 0) value1 = value1 + data[i];         else value2 = value2 + data[i];     }     if (value1 == value2) return value1;      status[n] = 1;     value1 = value2 = 0;     for (i = 0; i < len; i++)     {         if (status[i] == 0) value1 = value1 + data[i];         else value2 = value2 + data[i];     }     if (value1 == value2) return value1;      return 0; }  int main(void) {     int data[MAXLEN], status[MAXLEN];     int d, ret, len = 0;      while(1)     {         scanf("%d", &d);         if (d == -1) break;         data[len++] = d;     }      ret = handler(data, status, 0, len);      if (ret > 0) printf("Yes\n%d\n", ret);     else printf("No\n");      return 0; }  谢谢你，谢谢你

user: user-1
content: 无比暴力，仅供参考： #include <stdio.h> #define MAXLEN 1024  int handler(int data[], int status[], int n, int len) {     int value1, value2, ret, i;      if (n < len-1)     {         status[n] = 0;         ret = handler(data, status, n + 1, len);         if (ret) return ret;          status[n] = 1;         ret = handler(data, status, n + 1, len);         if (ret) return ret;     }      status[n] = 0;     value1 = value2 = 0;     for (i = 0; i < len; i++)     {         if (status[i] == 0) value1 = value1 + data[i];         else value2 = value2 + data[i];     }     if (value1 == value2) return value1;      status[n] = 1;     value1 = value2 = 0;     for (i = 0; i < len; i++)     {         if (status[i] == 0) value1 = value1 + data[i];         else value2 = value2 + data[i];     }     if (value1 == value2) return value1;      return 0; }  int main(void) {     int data[MAXLEN], status[MAXLEN];     int d, ret, len = 0;      while(1)     {         scanf("%d", &d);         if (d == -1) break;         data[len++] = d;     }      ret = handler(data, status, 0, len);      if (ret > 0) printf("Yes\n%d\n", ret);     else printf("No\n");      return 0; }