728x90
반응형

직사각형 좌표구하기

def find_missing_point(points):
    x_coords = []
    y_coords = []
    for point in points:
        x_coords.append(point[0])
        y_coords.append(point[1])

    missing_x = 0
    missing_y = 0
    for x in x_coords:
        if x_coords.count(x) == 1:
            missing_x = x

    for y in y_coords:
        if y_coords.count(y) == 1:
            missing_y = y

    return missing_x, missing_y

# 3개의 좌표
points = [(1, 1), (1, 3), (3, 1)]

# 나머지 한 점의 좌표 계산
missing_point = find_missing_point(points)

print("나머지 한 점의 좌표:", missing_point)
728x90
반응형

+ Recent posts