求求了
#include <bits/stdc++.h>
using namespace std;
int main()
{
int m,n,t=0,i1=0;
double temp=0;
cin>>m;
for(int i=0;i<m;i++)
{
temp=0;
cin>>n;
int a[n];
for(int j=0;j<n;j++)
{
cin>>a[j];
temp+=a[j];
}
t=temp/2;
for(int j=0;j<n;j++)
{
if(t>0) t-=a[j];
if(t=0){i1=j;break;}
if(t<0) break;
}
if(i1)cout<<i1<<endl<<t<<endl<<temp<<"Yes"<<endl;
else cout<<i1<<endl<<t<<endl<<temp<<"No"<<endl;
}
return 0;
}
大佬看一眼