1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.util.Scanner;
 
public class java2439 {
 
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
 
        int num = scan.nextInt();
 
        for(int i=0; i<num; i++) {
            for(int k=0;k<num-i-1;k++) {    
                System.out.print(" ");
            }
            for(int j=0;j<i+1;j++) {
                System.out.print("*");
            }
            System.out.print("\n");
        }
    
    }
cs


-백준

'웹개발 > 알고리즘' 카테고리의 다른 글

11720번 숫자의 합  (0) 2017.10.21
11721번 열 개씩 끊어 출력하기  (0) 2017.10.21
1924번 2007년  (0) 2017.10.21

+ Recent posts