小编cin*_*mon的帖子

如何在控制台中显示一个简单的空心星号矩形?

有人可以用一种简单的方法告诉我在C#中实现空心矩形吗?

我已经能够制作一个简单的矩形,但我看到的是空心矩形程序,无论是包含还是数组,或者都是非常复杂的.例如,另一个论坛上的解决方案似乎过于具有挑战性,而CodeReview.SE上的这个答案太难理解了.

这就是我所做的,它显示了一个简单的(填充)矩形.if如果可能,如何使用逻辑输出空心矩形?

class Nested_Loops_Hollow_Rectangles
{
    public void RunExercise()
    {
        // how are now supposed to make this hollow?
        // columns are side by side, rows is number of top to bottom
        // see tut
        Console.WriteLine("Welcome to the HollowRectanglePrinter Program.");
        Console.WriteLine("How many columns wide should the rectangle be?"); //i.e. 4
        int iColMax, iRowMax;
        string userChoiceC = Console.ReadLine();
        Int32.TryParse(userChoiceC, out iColMax);
        Console.WriteLine("How many rows tall should the rectangle be?  "); //i.e. 4
        string userChoiceR = …
Run Code Online (Sandbox Code Playgroud)

c# algorithm loops

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

algorithm ×1

c# ×1

loops ×1