表达式中的数字最多有100001 (1e5+1) 个,所以b数组开大点(至少100001)就行
by Anli_li_father @ 2023-07-27 19:16:57
@[Anli_li_father](/user/805653) 原来如此,多谢
by U202215667 @ 2023-07-27 19:53:04
一种超级简单的方法
```cpp
#include <iostream>
using namespace std;
int main(){
unsigned long long a,b,k;
cin >> b;
char s;
while(cin >> s >> k){
if(s == '*'){
b = b * k % 10000;
}else{
a = (a+b) % 10000;
b = k;
}
}
cout << (a+b) % 10000 << endl;
return 0;
}
```
by lucas_777 @ 2023-08-13 19:22:14
兄弟,开O2就满分了
by huang_rijin @ 2023-08-24 09:31:24