编辑代码

using System;
using System.Collections.Generic;

public class point
{
    public double X
    public double Y
    public Point(double x,double y)
    {
        this.X=x;
        this,Y=y:
    }
}

public class HelloWorld
{
    public static double CalcPolygonArea(List<Point>Points)
    {
        double area=0;//存储面积
        int index=Points.Count;//顶点个数
        for(int i=0:<index-1:i++)
        {
            area+=(Points[i].X+points[i+1].X)*(Points[i+1].Y-Points[i].Y);
        }
        area+=(Points[index-1].X+points[0].X)*(Points[0].Y-Points[index-1].Y);
        return Math,Abs(area)*0.5;
    }

    public static void Main()
    {
       List<Point>Points=new List<Point>()
       {
           new Point()
           new Point()
           new Point()
           new Point()
           new Point()
           new Point()
       };
       double area=CalcPolygonArea(Points);
        Console.WriteLine("小登的多边形的面积 ");
    }
}