| 记录编号 | 122641 | 评测结果 | AAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1229.多边形面积 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.001 s | ||
| 提交时间 | 2014-09-24 09:03:16 | 内存使用 | 0.29 MiB | ||
#include<cstdio>
using namespace std;
int a[101],b[101];int n,s=0;
int main()
{
freopen("areas.in","r",stdin);freopen("areas.out","w",stdout);
scanf("%d",&n);for(int i=1;i<=n;i++)scanf("%d%d",&a[i],&b[i]);a[0]=a[n];b[0]=b[n];for(int i=0;i<n;i++)s+=(a[i]*b[i+1]-a[i+1]*b[i]);s/=2;printf("%d",s);
}