P10057 题解
FurippuWRY · · 题解
很明显,答案只会是
#include<bits/stdc++.h>
using namespace std;
int x[10], y[10], n;
int main() {
cin >> n;
while (n--) {
for (int i = 1; i <= 4; ++i) cin >> x[i] >> y[i];
if (x[3] <= x[2] && x[3] >= x[1]) {
if (max(y[3], y[4]) >= y[1] && min(y[3], y[4]) <= y[1]) cout << 0 << '\n';
else cout << 1 << '\n';
}
else if (max(y[3], y[4]) >= y[1] && min(y[3], y[4]) <= y[1]) cout << 1 << '\n';
else cout << 2 << '\n';
}
return 0;
}