https://www.acmicpc.net/problem/2438

 

2438번: 별 찍기 - 1

첫째 줄에는 별 1개, 둘째 줄에는 별 2개, N번째 줄에는 별 N개를 찍는 문제

www.acmicpc.net


import java.util.*;
import java.io.*;

class Main{
    public static void main(String[]args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        int num = Integer.parseInt(br.readLine());
        for(int j=1;j<=num;j++){
        for(int i=0;i<j;i++){
            System.out.print("*");
        }
         System.out.print("\n");   
        }
        
        
    }
}

'알고리즘 문제 > PYTHON' 카테고리의 다른 글

[백준] 2588번: 곱셈 (python)  (0) 2021.07.02
[백준] 2558번: A+B -2 (python)  (0) 2021.07.02
[백준] 1008번: A/B (python)  (0) 2021.07.01
[백준] 1001번: A-B (python)  (0) 2021.07.01
[백준] 1000번: A+B (python3)  (0) 2021.07.01

+ Recent posts