题目:
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);
}
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- huatuo0.cn 版权所有 湘ICP备2023017654号-2
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务