using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class CPoint
{
public int x, y;
public CPoint()
{ }
public CPoint(int x, int y)
{
this.x = x;
this.y = y;
}
}
class CLine:CPoint
{
public static double Getlength(CPoint p1,CPoint p2)
{
return Math.Sqrt ((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
}
}
class CRect : CLine
{
public static double Getarea(CPoint p1,CPoint p2,CPoint p3)
{
return (Getlength(p1,p2)*Getlength(p2,p3));
}
public static double Getzc(CPoint p1,CPoint p2,CPoint p3)
{
return (2*(Getlength(p1,p2)+Getlength(p2,p3)));
}
}
class Program
{
static void Main(s
求矩形边长,面积及周长(c#实现)
最新推荐文章于 2023-10-15 10:45:12 发布