백준

백준 2441번 문제 별 찍기 - 4 (Java)

gxxgsta 2021. 4. 20. 09:13
반응형
SMALL
package star;

import java.util.Scanner;

public class Main {
    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();
        }
    }
}

 

반응형
LIST