본문 바로가기
with my rubber duck/codingTest

백준 2438 별 찍기 - 1 껌이지~

by stilinski 2022. 4. 6.
728x90

문제

나의 답:

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		
		Scanner sc = new Scanner(System.in);
		
		int num = sc.nextInt();
		
		for(int i = 1,n=num;i<=n;i++) {
			for(int j=1;j<=i;j++) {
				System.out.print("*");
			}
			System.out.println();
		}
		
	}

}

유후

728x90

댓글