1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import java.util.*; public class Main{ public static void main(String[] args){ int N=0; Scanner scan=new Scanner(System.in); N=scan.nextInt(); if(N<=100 && N>=1) { for(int i=1;i<=N;i++){ for(int j=1;j<=N-i;j++){ System.out.print(" "); } for(int k=1;k<=i;k++) { System.out.print("*"); } System.out.println(); } } } } | cs |
'+ α > 알고리즘 문제풀이' 카테고리의 다른 글
유클리드 호제법: 최대공약수 알고리즘(Java, Python) (0) | 2021.05.14 |
---|---|
[Java] 백준 2438번_별찍기1 (0) | 2020.07.01 |
댓글