백준: 2441(별 찍기 - 4)

강지안·2023년 9월 6일
0

baekjoon

목록 보기
183/186

문제

코드

import java.util.Scanner;

public class q2441 {
    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(" ");
            for(int j=0; j<N-i; j++) System.out.print("*");
            System.out.println();
        }
    }
}

0개의 댓글