提交时间:2025-01-23 15:36:18

运行 ID: 5182

#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a,b; char j,d,c; int temp = 0; for(int i = 0;i < n;i++) { cin>>a>>j>>b>>d>>c; if(c == '?') { continue; } if(j == '+') { if(a + b == c) { temp++; } } if(j == '-') { if(a - b == c) { temp++; } } } cout<<temp<<endl; return 0; }