• 2024-11-072287: 【例28.3】 数列分段
    include<bits/stdc++.h>usingnamespacestd;intn,m,sum,num;intmain(){cin>>n>>m;for(inti=1;i<=n;i++){inte;cin>>e;if(num+e>m){sum++;num=e;}else{num+=e;}}cout<<sum+1;return0;}反思:这段代