티스토리 뷰
먼저 공백을 print하고 *을 프린트 해주면 된다
import java.io.BufferedReader;
import java.io.InputStreamReader;
class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n - i; j++)
                System.out.print(" ");
            for (int j = 1; j <= i; j++)
                System.out.print("*");
            System.out.println("");
        }
    }
}'알고리즘 > 문제풀이' 카테고리의 다른 글
| [BOJ-1011] Fly me to the Alpha Centauri (0) | 2023.11.24 | 
|---|---|
| [BOJ-1271] 엄청난 부자2 (0) | 2023.08.26 | 
| [BOJ-1000] A+B (0) | 2023.08.26 | 
									댓글
										
									
									
									
									
 									
									
								
							
										공지사항
										
								
							
							
							
								최근에 올라온 글
								
							
							
								
									최근에 달린 댓글
									
							
							
								- Total
- Today
- Yesterday
									링크
									
								
							
							
								
							
							
							
							
					
