PAT模拟题---1046 划拳 (15分)

1046 划拳 (15分)
简单模拟

#include<iostream>

using namespace std;

int main(){
	int n;cin>>n;
	int ans1=0,ans2=0;
	while(n--){
		int a1,a2,b1,b2;
		cin>>a1>>a2>>b1>>b2;
		int ans=a1+b1;
		if(a2==ans&&b2==ans){
			continue;
		}
		if(a2==ans){
			ans2++;
			continue;
		}
		if(b2==ans){
			ans1++;
			continue;
		}
	}
	cout<<ans1<<" "<<ans2;
	return 0;
}
原文地址:https://www.cnblogs.com/bingers/p/13061148.html