每日第三题,做题第二天
题目:

本题也不难,还是对数组的应用,下面是完整的代码。
#include<iostream>
using namespace std;
int main() {
int n,a[100][4],x=0,y=0;
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < 4; j++) {
cin >> a[i][j];
}
}
for (int i = 0; i < n; i++) {
if ((a[i][0] + a[i][2]) == a[i][1] && (a[i][0] + a[i][2]) != a[i][3]) {
y++;
}
if ((a[i][0] + a[i][2]) != a[i][1] && (a[i][0] + a[i][2]) == a[i][3]) {
x++;
}
}
cout << x <<" "<< y << endl;
return 0;
}```
189

被折叠的 条评论
为什么被折叠?



