链接

思路:直接跑模板

#include <bits/stdc++.h>

using namespace std;
int n;
const double eps=1e-8;
int sgn(double x)
{
    if(fabs(x)<eps) return 0;
    if(x<0) return -1;
    else return 1;
}
struct Point{
    double x,y;
    Point(){}
    Point(double _x,double _y){
        x=_x;
        y=_y;
    }
    //叉积
    double operator ^(const Point &b)const{
        return x*b.y-y*b.x;
    }
    //点积
    double operator *(const Point &b)const{
        return x*b.x+y*b.y;
    }
    void input(){
        scanf("%lf %lf",&x,&y);
    }
};
struct Line{
    Point s,e;
    Line(){}
    Line(Point _s,Point _e){
        s=_s;
        e=_e;
    }
};
struct polygon{
    int n;
    Point p[35];
    Line l[35];
    bool getdir(){
        double sum=0;
        for(int i=0;i<n;i++){
            sum+=(p[i]^p[(i+1)%n]);
        }
        if(sgn(sum)>0) return 1;
        return 0;
    }
};
int main()
{
    scanf("%d",&n);
    polygon pp;
    pp.n=n;
    for(int i=0;i<n;i++){
        scanf("%lf %lf",&pp.p[i].x,&pp.p[i].y);
    }
    if(pp.getdir()){
        cout<<"counterclockwise";
    }
    else cout<<"clockwise";
}