C#/수업 내용

별찍기 2 (for문)

Bueong_E 2023. 1. 3. 12:38
반응형
SMALL
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Study02
{
    class Program
    {        
        static void Main(string[] args)
        {           
                
            for (int i = 0; i < 5; i++)
            {
                for (int h = 0; h < 5 - (i + 1); h++)
                {
                    Console.Write(" ");


                }
                for (int j = 0; j <= i; j++)
                {
                   
                    Console.Write("*");
                }
                
                Console.WriteLine();
            }


        }

    }
}
반응형
LIST