用C#怎么打印出这个图案

[复制链接]
查看11 | 回复3 | 2009-7-3 13:36:41 | 显示全部楼层 |阅读模式
static void Main(string[] args){
string str = "*";
Console.WriteLine(str);
for (int index = 1; index < 7; index++)
{
str = str + "*";
if (index % 2 == 0)
{
Console.WriteLine(str);
}
}}还有什么问题继续问我...
回复

使用道具 举报

千问 | 2009-7-3 13:36:41 | 显示全部楼层
static void Main(string[] args){
string str = "*";
Console.WriteLine(str);
for (int index = 1; index < 7; index++)
{
str = str + "*";
if (in...
回复

使用道具 举报

千问 | 2009-7-3 13:36:41 | 显示全部楼层
string str="";for(int i=0;i<4;i++){str+="**";//WEB中用Response.Write(str.Substring(0,str.Length-1)+"
);//WinForm中用Console.WriteLine(str.Substring(0,str.Length-1));...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行