프로그래머스 - 직각삼각형 출력하기

차관호·2023년 3월 7일
0

문제링크 - 프로그래머스 - 직각삼각형 출력하기

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 = 1; i<=n;i++){
            for(int j=0;j<i;j++){
                System.out.printf("*");
            }
            System.out.println();
        }
    }
}
profile
안녕하세요 :-)

0개의 댓글