比赛 板子大赛 评测结果 AAAAAAAAAA
题目名称 表达式求值 最终得分 100
用户昵称 李奇文 运行时间 0.120 s
代码语言 C++ 内存使用 3.32 MiB
提交时间 2025-01-22 10:42:05
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
int a,b,c; 
char s;
int main(){
	freopen("expr2013.in","r",stdin);
	freopen("expr2013.out","w",stdout);
    std::cin>>a;
    while(std::cin>>s){ 
        std::cin>>c;
        if(s=='*') a=a*c%10000; 
        else b=(b+a)%10000,a=c;
       
    }
	std::cout<<(a+b)%10000; 
    return 0;
}