题解 | #二维数组操作#

二维数组操作

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


def func():
    m, n = list(map(int, input().split()))
    if 1 <= m <= 9 and 1 <= n <= 9:
        print('0')
    else:
        print('-1')

    x1, y1, x2, y2 = list(map(int, input().split()))
    if 0 <= x1 < m and 0 <= x2 < m and 0 <= y1 < n and 0 <= y2 < n:
        print('0')
    else:
        print('-1')
    
    x = int(input())
    if 0 <= x < m and m < 9:
        print('0')
    else:
        print('-1')

    y = int(input())
    if 0 <= y < n and n < 9:
        print('0')
    else:
        print('-1')

    x, y = list(map(int, input().split()))
    
    if 0 <= x < m and 0 <= y < n:
        print('0')
    else:
        print('-1')

while True:
    try:
        func()
    except EOFError:
        break














全部评论

相关推荐

10-05 11:11
海南大学 Java
投票
理想江南137:感觉挺真诚的 感觉可以试一试
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务