题解 | 纸牌游戏
纸牌游戏
https://www.nowcoder.com/practice/74f915e366094b19b94334de8b68e733
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--)
{
int a1,a2,b1,b2;
cin >> a1>>a2>> b1>>b2;
if(a1<a2)
{
int temp = a1;
a1 = a2;
a2 = temp;
}
if(b1<b2)
{
int temp = b1;
b1 = b2;
b2 = temp;
}
if (a1<b1||a2<b2||
a1==b1&&a2==b2)
{
cout << 0 << endl;
continue;
}
if (a2>b1||
a2==b1&&(a1!=a2||b1!=b2))
{
cout << 4 << endl;
continue;
}
cout << 2<<endl;
}
}
