728x90

 

String[] s;

Console.Clear();
s = Console.ReadLine().Split(' ');

int n = Int32.Parse(s[0]);
for (int i = 0; i < n; i++)
{
    for (int j = 0; j < i+1; j++)
    {
        Console.Write("*");
    }
    Console.WriteLine("");
}

for j문에서 별을 찍고 for i문에서 엔터 역할을 합니다

728x90

'프로그래머스' 카테고리의 다른 글

암호 해독  (0) 2023.10.18
로그인 성공  (0) 2023.10.18
제곱수 판별  (0) 2023.10.18
숨어있는 숫자의 덧셈  (0) 2023.10.17
[프로그래머스] 최빈값 구하기  (0) 2023.10.17
Posted by 바르마스
,