Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 26, 2024
1 parent da8aae2 commit 8a5c272
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions content/5_Plat/Geo_Pri.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -258,22 +258,23 @@ int main() {

```py
class Point:
def __init__(self, x: int = 0, y: int = 0):
self.x = x
self.y = y
def __init__(self, x: int = 0, y: int = 0):
self.x = x
self.y = y


n = int(input())
points = []

for _ in range(n):
x, y = map(int, input().split())
points.append(Point(x, y))
x, y = map(int, input().split())
points.append(Point(x, y))

points.append(points[0])

area = 0
for i in range(n):
area += points[i].x * points[i + 1].y - points[i].y * points[i + 1].x
area += points[i].x * points[i + 1].y - points[i].y * points[i + 1].x

print(abs(area))
```
Expand Down

0 comments on commit 8a5c272

Please sign in to comment.