[JAVA 문제 풀이] 직각삼각형 출력하기

Stupefyee's avatar
Nov 18, 2024
[JAVA 문제 풀이] 직각삼각형 출력하기
notion image

내가 작성한 코드

💡
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 0; i < n; i++) { for (int j = 0; j <= i; j++) { System.out.printf("*"); } System.out.println(); } } }
 
Share article

stupefyee