[백준] 2438 : 별 찍기 - 1 - Java

길 잃은 까마귀·2022년 9월 14일
0

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


  • 문제

  • 풀이
    이중 for문을 활용 하는 문제이다.

  • 코드
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		for (int i = 1; i <= N; i++) {
			for (int t = 1; t <= i; t++) {
				System.out.printf("*");
			}
			System.out.printf("\n");
		}
		sc.close();
	}
}
profile
코딩 고수가 될 사람

0개의 댓글