[알고리즘문제풀기]직삼각형 출력하기

프로그래머스 입문 문제
송송승현's avatar
Dec 27, 2024
[알고리즘문제풀기]직삼각형 출력하기

문제

나의 해답

import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i=0; i<n; i++){ for(int j=0;j<=i;j++){ System.out.print("*"); } System.out.println(); } } }
Share article

송승현의 블로그