@[qianwanlang](/user/556281) 猜测是因为每一次递归都会建一个 `string` 然后炸空间了。实际上这个代码就是把表达式的最后一位滞留在最后计算,也就是从左往右逐个计算,你搞复杂了。可以参考题解做法。
by Sheez @ 2023-05-03 11:17:16
```
#include<bits/stdc++.h>
using namespace std;
int a,t;
int main()
{
while(cin>>t) a+=t;
cout<<a;
return 0;
}
```
告诉你一个秘密,a-b在c++里就是a+(-b)
by yejingzhi @ 2023-10-28 18:28:28