当前位置: 代码迷 >> 综合 >> PATB:1048划拳
  详细解决方案

PATB:1048划拳

热度:73   发布时间:2023-12-25 03:35:32.0

这里写图片描述

#include"stdio.h"
int main()
{int n, cnt1 = 0, cnt2 = 0;scanf("%d", &n);for (int i = 0; i < n; i++) {int a1, a2, b1, b2;     //a1为甲喊,a2甲划,b1乙喊,b2乙划scanf("%d %d %d %d", &a1, &a2, &b1, &b2);if (a2 == a1 + b1 && b2 != a1 + b1) {cnt2++;}else if (a2 != a1 + b1 && b2 == a1 + b1) {cnt1++;}}printf("%d %d", cnt1, cnt2);return 0;
}