华佗小知识
您的当前位置:首页My brother‘s homework<字符串>

My brother‘s homework<字符串>

来源:华佗小知识

题目:

 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);
}

因篇幅问题不能全部显示,请点此查看更多更全内容