๐Ÿ•ธ Algorithm/๐Ÿ•ธ ๋ฐฑ์ค€ BaekJoon

[๋ฐฑ์ค€][java][2438][๋ณ„ ์ฐ๊ธฐ - 1]

๋‰ด์ด NUEY 2023. 10. 9. 21:38
๋ฐ˜์‘ํ˜•

import java.util.Scanner;

public class Main {
	// 2438	๋ณ„ ์ฐ๊ธฐ - 1
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int t = sc.nextInt();
		String star = "";
		
		for (int i=0; i<t; i++) {
			star += "*";
			System.out.println(star);
		}
	}
}

๋ณ€์ˆ˜๋งŒ for๋ฌธ ๋ฐ–์— ์„ ์–ธํ•˜๊ณ  for๋ฌธ ์•ˆ์— " * " ๋ณ„๋งŒ ๋”ํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

๋ฐ˜์‘ํ˜•