本文整理汇总了C#中Sphere.Volume方法的典型用法代码示例。如果您正苦于以下问题:C# Sphere.Volume方法的具体用法?C# Sphere.Volume怎么用?C# Sphere.Volume使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sphere
的用法示例。
在下文中一共展示了Sphere.Volume方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//.........这里部分代码省略.........
i = 0;
}
count = 0;
}
else if (whatShape == "Square")
{
TwoDim squ = new Square();
foreach (var item in twodim)
{
if (twodim[i].typeTwo == 4 && twodim[i].numTwo == number)
{
Console.WriteLine("이미 담은 도형입니다.");
count += 1;
break;
}
i++;
}
if (count == 0)
{
squ.typeTwo = 4;
squ.numTwo = number;
squ.Length(number);
squ.Area(number);
twodim.Add(squ);
i = 0;
}
count = 0;
}
else if (whatShape == "Circle")
{
TwoDim cir = new Circle();
foreach (var item in twodim)
{
if (twodim[i].typeTwo == 0 && twodim[i].numTwo == number)
{
Console.WriteLine("이미 담은 도형입니다.");
count += 1;
break;
}
i++;
}
if (count == 0)
{
cir.typeTwo = 0;
cir.numTwo = number;
cir.Length(number);
cir.Area(number);
twodim.Add(cir);
i = 0;
}
count = 0;
}
else if (whatShape == "Cube")
{
ThreeDim cub = new Cube();
foreach (var item in threedim)
{
if (threedim[i].numThree == number && threedim[i].typeThree == 6)
{
Console.WriteLine("이미 담은 도형입니다.");
count += 1;
break;
}
i++;
}
if (count == 0)
{
cub.typeThree = 6;
cub.Area(number);
cub.Volume(number);
threedim.Add(cub);
i = 0;
}
count = 0;
}
else if (whatShape == "Sphere")
{
ThreeDim sph = new Sphere();
foreach (var item in threedim)
{
if (threedim[i].numThree == number && threedim[i].typeThree == 6)
{
Console.WriteLine("이미 담은 도형입니다.");
count += 1;
break;
}
i++;
}
if (count == 0)
{
sph.typeThree = 0;
sph.Area(number);
sph.Volume(number);
threedim.Add(sph);
i = 0;
}
count = 0;
}
}
}