```
n = int(sys.stdin.readline())
point = []
for _ in range(n):
a, b = map(int, sys.stdin.readline().split())
point.append([a, b])
xold, yold = point.pop(0)
Point.append([xold, yold]) # After selecting the starting point, add the starting point again at the end.
area = 0
while point:
nx, ny = point.pop(0)
area += (old +ny) * (nx - xold) / 2 # Add trapezoidal width
xold, yold = nx, ny
print("%.1f" % abs(area))
```

C (n) It's a code to find the width of a square
This is what I drew on the canvas,

I logarithmically took the coordinate values of the squares in the figure

Where should I put this coordinate value as a variable to calculate the result value in print statement??

python

2022-09-20 08:43

```
point = [
[38, 58],
[38, 59],
[38, 60],
[38, 61],
[38, 62],
[38, 63],
[38, 64],
[38, 65],
[39, 66],
]
xold, yold = point.pop(0)
Point.append([xold, yold]) # After selecting the starting point, add the starting point again at the end.
area = 0
while point:
nx, ny = point.pop(0)
area += (old +ny) * (nx - xold) / 2 # Add trapezoidal width
xold, yold = nx, ny
print("%.1f" % abs(area))
```

You can do this under the assumption that you use the code as much as you can.

2022-09-20 08:43

Popular Tags

Popular Questions

13 I want to apply all the files in the folder as a for statement.

9 I'd like to specify a specific order when selecting Python characters randomly, is it possible?

13 If parameter X determines the return value Y, which function name would be the most appropriate?

7 Python if continue in the door

8 I have a question about the pointer! *z = ~(hap & 0xFF); What does ~ mean in?

© 2022 pinfo. All rights reserved.