Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
92591 孙嘉言 22计算算术表达式 C++ Wrong Answer 1 MS 268 KB 367 2024-10-05 17:36:06

Tests(0/2):


Code:

#include <iostream> #include <algorithm> using namespace std; int main(){ char b; int n,a,c; cin>>n; for(int i=0;i<n;i++){ cin>>a>>b>>c; if(b=='+') cout<<a+c; if(b=='-') cout<<a-c; if(b=='*') cout<<a*c; if(b=='/') cout<<a/c; if(b=='%') cout<<a%c; } return 0; }


Run Info:

------Input------
5 5+4 3*7 8/3 9-9 12%2
------Answer-----
9 21 2 0 0
------Your output-----
921200