• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Oct 24th, 2019 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. # -*- coding: utf-8 -*-
2.
3. def kek(A, B) : #делаем так чтобы первым стояла левая нижнияя координата
4.     A_x, A_y = A[0], A[1]
5.     B_x, B_y = B[0], B[1]
6.     return (min(A_x, B_x), min(A_y, B_y)), (max(A_x, B_x), max(A_y, B_y))
7.
8. def lol(A, B, C) : ##на входе две точки описывающие прямоугольник. C-пользователь
9.     A, B = kek(A, B)
10.
11.     if A[0] < C[0] < B[0] and A[1] < C[1] < B[1] :
12.         return 1 ##точка входит в область
13.
14.     else :
15.         return 0
16.
17.
18. if __name__ == '__main__':
19.     A = list(map(float, input().split()))
20.     B = list(map(float, input().split()))
21.     C = list(map(int, input().split()))
22.     print(lol(A, B, C))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Top