Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
5301 A班-许锘林 弟弟的作业 C++ 解答错误 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; }


测评信息: