알고리즘/백준

[java] 백준 2439

henry.hong 2019. 11. 29. 16:17
import java.util.Scanner;

public class P2439 {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        int loop = s.nextInt();

        for(int i = 0 ; i < loop ; i++){
            StringBuffer sb = new StringBuffer();
            for(int j = 0; j <= i ; j++){
                sb.append("*");
            }
            System.out.println(String.format("%"+loop+"s", sb.toString()));
        }
    }
}