๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿš€ Algorithm/BOJ

2439

 

 

 

 

 

 

 

import java.util.Scanner;
public class Main {
 
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
 
		int N = in.nextInt();
		in.close();
 
		for (int i = 1; i <= N; i++) {
			for (int j = 1; j <= N - i; j++) {
				System.out.print(" ");
			}
			for (int k = 0; k < i; k++) {
				System.out.print("*");
			}
			System.out.println();
		}
    }
}

 

๋”๋ณด๊ธฐ

ํ‹€๋ฆฐ ์ด์œ >

 

11: j <= N - 1 ์ด๋ผ๊ณ  ์“ฐ๊ณ , j-- ๋ผ๊ณ  ์ผ์Œ

 

'๐Ÿš€ Algorithm > BOJ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

1110  (0) 2021.08.16
10952 10951  (0) 2021.08.15
10950  (0) 2021.08.14
2884  (0) 2021.08.14
2753  (0) 2021.08.12