Cod sursa(job #2299292)
| Utilizator | Data | 9 decembrie 2018 11:37:20 | |
|---|---|---|---|
| Problema | Aria | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.57 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("aria.in");
ofstream fout ("aria.out");
int n,i,a.s;
struct punct{
double x,y;
}v[1000];
int c_p(punct a, punct o, punct b)
{
int d=( a.x - o.x ) * ( b.y - o.y ) - ( b.x - o.y) * ( a.y - o.y );
if(d==0)return 1;
else if(d<0)return 2;
else if(d>0)return 3;
}
int main()
{
cin>>n;
for(i=1;i<=n;i++)
{
cin>>v[i].x>>v[i].y;
}
p.x=0;
p.y=0;
for(i=1;i<=n;i++)
{
a=c_p(v[i],p,v[i+1])/2;
s=s+a;
}
return 0;
}
