题解 | #二维数组操作#
二维数组操作
https://www.nowcoder.com/practice/2f8c17bec47e416897ce4b9aa560b7f4
#include <iostream>
using namespace std;
int main() {
int a, b;
int x1,y1,x2,y2;
int x,y;
while (cin>>a>>b){
//1.
if (a > 9 || b > 9) cout<< -1<<endl;
else cout<<0<<endl;
//2.
cin>>x1>>y1>>x2>>y2;
if (x1 >= a || x2 >= a || y1 >= b || y2 >= b) cout<<-1<<endl;
else cout<<0<<endl;
//3/4.
cin>>x>>y;
if (x >= a || a == 9) cout<<-1<<endl;
else cout<<0<<endl;
if (y >= b || b == 9) cout<<-1<<endl;
else cout<<0<<endl;
//5.
cin>>x>>y;
if (x >= a || y >= b) cout<<-1<<endl;
else cout<<0<<endl;
}
}
// 64 位输出请用 printf("%lld")
