포스트

(C#) 14. 코드의 흐름 제어 (별 찍기 예제)

별 찍기 연습 문제

(C#) 14. 코드의 흐름 제어 (별 찍기 예제)

( )

  • 최초 작성일: 2021년 3월 21일(월)

##

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;

namespace ex2
{
    class Program
    {
        static void Main(string[] args)
        {
            // 별 찍기
            for (int i = 0; i < 5; i++) 
            {
                for (int j = 0; j <= i; j++) 
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }
        }
    }
}


Result

image

이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.