using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace methodexample_10._5_
{
class Program
{
static void Main(string[] args)
{
calculator c = new calculator();
Console.WriteLine(c.GetCircleArea(10));
}
}
class calculator
{
public double GetCircleArea(double r)
{
return Math.PI* r * r;
}
public double GetCylinderVolume(double r,double h)
{
return GetCircleArea(r) * h;
}
public double GetConeVolume(double r,double h)
{
return GetCylinderVolume(r,h)/3;
}
}
}
C#圆、圆柱、圆锥体积实例
最新推荐文章于 2022-06-01 23:06:58 发布