美文网首页
循环嵌套联系 Day0815

循环嵌套联系 Day0815

作者: 段然丶 | 来源:发表于2017-08-15 17:34 被阅读0次

/*    1

*  21

*  321

* 4321

*54321

for (int i = 1; i <= 5; i++)

{                  

                    for (int j = 1; j <= 5 - i; j++)

                      { Console.Write(" ");}

                    for (int k = i; k >= 1; k--)

                        {Console.Write(k);}

Console.WriteLine();

}

//九九乘法表

for (int i = 1; i <= 9; i++)

{

                for (int j = 1; j <= i; j++)

                {        Console.Write("{0}*{1}={2}\t",j,i,j*i);    }

               Console.WriteLine();

}

相关文章

网友评论

      本文标题:循环嵌套联系 Day0815

      本文链接:https://www.haomeiwen.com/subject/rbevrxtx.html