题目:
AC代码 如下
#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int main()
{
int i = 0, j, count = 0;
int a[100], b[100], c[100];
char d[100];
while(scanf("%d%c%d=%d", &a[i], &d[i], &b[i], &c[i]) != EOF)
{
i++;
getchar();
}
for(j = 0; j < i; j++)
{
if((d[j] == '+'&&a[j] + b[j] == c[j])||(d[j] == '-'&&a[j] - b[j] == c[j]))
count++;
}
printf("%d\n", count);
}