백준 #7595번 Triangles

jhj·2024년 2월 9일

백준 JAVA

목록 보기
182/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		while(a != 0) {
			for(int i = 1; i <= a; i++) {
				for(int j = 1; j <= i; j++) {
					System.out.print("*");
				}
				System.out.println();
			}
			a = sc.nextInt();
		}
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글