我正在尝试打印
*
**
***
****
*****
和
*****
****
***
**
*
使用“While”和“do - while”。
但我不知道如何解决这个问题。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a = 0;
int b = 0;
while (a <= 0)
{
while (b <= a)
{
Console.Write("*");
b++;
}
a++;
Console.WriteLine();
}
Console.ReadLine();
}
}
}
我一直在尝试像上面那样接近,但我认为它永远不会奏效!
PS 我将如何改进我的编程逻辑?我觉得我缺乏逻辑思维。