提交时间:2023-12-02 10:23:59

运行 ID: 113430

#include<bits/stdc++.h> using namespace std; int main() { int a,b,c[1005],d=0,e,f=0; cin>>a; for(b=1;b<=a;b++) { cin>>c[b]; d+=c[b]; } if(d%2==1) { cout<<"false"; return 0; } else { d/=2; sort ( c + 1 , c + a + 1 ); if(c[a]>d) { cout<<"false"; return 0; } for(e=1;e<=a;e++) { f+=c[e]; if(f>=d) break; } } if(f==d) cout<<"ture"; else cout<<"flase"; return 0; }