日期:2014-05-17 浏览次数:21466 次
static void Main(string[] args)
{
Round(8, '*');
}
//r为圆半径 s为组成圆的字符
static void Round(int r, char s)
{
for (int i = 0; i < r; i++)
{
int temp = (int)(2 * Math.Sqrt(2 * i * r - i * i));
int t = 2 * r - temp - 1;
for (int j = 0; j < t; j++)
{
Console.Write(' ');
}
Console.Write(s);
for (int j = 0; j < 2 * temp; j++)
{
Console.Write(' ');
}
Console.WriteLine(s);
}
for (int i = r - 2; i >= 0; i--)
{
int temp = (int)(2 * Math.Sqrt(2 * i * r - i * i));
int t = 2 * r - temp - 1;
for (int j = 0; j < t; j++)
&