Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
5301 A班-许锘林 弟弟的作业 C++ Wrong Answer 0 1 MS 248 KB 650 2025-02-01 15:51:28

Tests(0/1):


#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a,b; char j,d; string C; int temp = 0; for(int i = 0;i < n;i++) { cin>>a>>j>>b>>d; cin>>C; if(C[0] != '?') { int c = 0; if(sizeof(C) == 3) { c = (C[0] - '0') * 100; c = (C[1] - '0') * 10; c = (C[2] - '0') * 1; } else if(sizeof(C) == 2) { c = (C[0] - '0') * 10; c = (C[1] - '0') * 1; } else { c = (C[0] - '0') * 1; } if(j == '+' && a + b == c) { temp++; } else if(j == '-' && a - b == c) { temp++; } } } cout<<temp; return 0; }


Judgement Protocol: