#include int main() { int n,m,i,p,j,k,t,v,e,sho,ls,lp,q; int sum1=0; int sum2=0; int sum3=0; int a[n]; int b[m]; scanf("%d %d",&n,&m); for(i=0;i { scanf("%d",&a[i]); getchar(); sum1=sum1+a[i]; } for(p=0;p { scanf("%d",&b[p]); getchar(); sum2=sum2+b[p]; } sho=sum1+sum2; for(t=0;t { sum3=0; for(v=t;v { sum3=sum3+b[v]; if(sum3>sum1) e=sum3-sum1; else e=sum1-sum3; if (sho>e) { sho=e; ls=t; lp=v; } } } for(i=ls;i { printf("%d ",b[i]); } return 0;}#c语言学习##c语言编程#