题解 | #二维数组操作#

二维数组操作

https://www.nowcoder.com/practice/2f8c17bec47e416897ce4b9aa560b7f4

# 20241015
while True:
    try:
        m, n = list(map(int, input().split()))
        x1, y1, x2, y2 = list(map(int, input().split()))
        x = int(input())
        y = int(input())
        x3, y3 = list(map(int, input().split()))
        # 1
        if 0 <= m <= 9 and 0 <= n <= 9:
            print("0")
        else:
            print("-1")

        # 2
        if 0 <= x1 < m and 0 <= y1 < n and 0 <= x2 < m and 0 <= y2 < n:
            print("0")
        else:
            print("-1")
        # 3
        if 0 <= x < m and m < 9:
            print("0")
        else:
            print("-1")

        # 4
        if 0 <= y < n and n < 9:
            print("0")
        else:
            print("-1")

        # 5
        if 0 <= x3 < m and 0 <= y3 < n:
            print("0")
        else:
            print("-1")
    except:
        break

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务