#include <iostream>
using namespace std;
struct Point
{
int x, y; };
Point a[];
int main()
{
int n;
while (cin >> n && n != )
{
for (int i = ; i <= n; i++)
{
cin >> a[i].x >> a[i].y;
} double area = 0.0;
for (int i = ; i < n; i++)
{
int x1 = a[i].x;
int y1 = a[i].y;
int x2 = a[i + ].x;
int y2 = a[i + ].y;
area += 0.5*abs(x1*y2 - y1*x2);
}
int x1 = a[].x;
int y1 = a[].y;
int x2 = a[n].x;
int y2 = a[n].y;
area += 0.5*abs(x1*y2 - y1*x2);
printf("%.1lf\n", area);
}
}
相关文章
- 10-21【HDOJ6684】Rikka with Game(博弈)
- 10-21HDOJ.4578 Transformation (多种区间操作的线段树)
- 10-21HDOJ7060 Separated Number
- 10-21【HDOJ】2371 Decode the Strings
- 10-21hdoj1074--Doing Homework (DP 状态压缩)
- 10-21HDOJ1312 Red and black(DFS深度优先搜索)
- 10-21HDOJ 4276 The Ghost Blows Light(树形DP)
- 10-21hdoj1702//栈和队列(头文件)
- 10-21HDOJ 1093
- 10-21HDOJ1020 Encoding