码迷,mamicode.com
首页 > 其他好文 > 详细

星星拼成的五角星

时间:2016-04-18 11:44:12      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

//shang
for (int h1 = 1; h1 <= 5; h1++)
{
for (int k1 = 0; k1 <= 14 - h1; k1++)
{
Console.Write("5");

}
for (int x1 = 1; x1 <= h1; x1++)
{
Console.Write("☆");
}

 

Console.Write("\n");


}


//zhongshang
for (int h2 = 1; h2 <= 4; h2++)
{

for (int k2 = 1; k2 <= h2-1; k2++)
{
Console.Write("55");
}
for (int x2=0;x2<=16-h2*2 ;x2++ )
{
Console.Write("☆");
}

 

Console.Write("\n");


}
//zhongxia
for (int h3=1;h3<=2 ;h3++ )
{
for (int k3=1;k3<= 7-h3; k3++)
{
Console.Write("5");

}
for (int x3=0;x3<=h3+7 ;x3++ )
{
Console.Write("☆");
}


Console.Write("\n");
}
//xia
for (int h4=1; h4<=4;h4++ )
{
for (int k4=1; k4<=5-h4; k4++)
{

Console.Write("5");


}



for (int x4 = 1; x4 <= 5 - h4;x4++)
{

Console.Write("☆");


}
for (int k41=1;k41<=6*h4 ; k41++)
{

Console.Write("5");
}

for (int x41 = 1; x41 <= 5 - h4; x41++)
{

Console.Write("☆");
}

Console.Write("\n");

 

}

 

星星拼成的五角星

标签:

原文地址:http://www.cnblogs.com/zzc134680/p/5403568.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!