1046.划拳


要注意喊得相等的情况。


#include <iostream>
using namespace std;

int main() {
	
	int n;
	cin >> n;
	
	int a[101][101];
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < 4; j++) {
			cin >> a[i][j];
		}
	}
	
	int j = 0, y = 0;
	for(int i = 0; i < n; i++) {
		if(a[i][0] + a[i][2] == a[i][1] && a[i][1] != a[i][3]) {
			y++;
		} else if (a[i][0] + a[i][2] == a[i][3] && a[i][1] != a[i][3]) {
			j++;
		}
	}
	
	cout << j << " " << y;
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_39227338/article/details/80418492
今日推荐