본문 바로가기

코딩테스트 예제

프로그래머스 직각삼각형 예제

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 = 1; j < i+1; j++){
                
                System.out.print("*"); 
           	 }
            System.out.println();
        }
       
    }
}