반응형
public class Ex1 { public static void main(String[] args) { for (int i = 1; i <= 5; i++) { for (int k = 1; k <= 5 - i; k++) { System.out.print(" "); } for (int j = 1; j <= i; j++) { System.out.print("*"); } System.out.println(""); } for (int d = 1; d <= 5; d++) { for (int c = 1; c <= d; c++) { System.out.print(" "); } for (int b = 4; b >= d; b--) { System.out.print("*"); } System.out.println(""); } } }
반응형
'JAVA' 카테고리의 다른 글
[JMS]Activemq 메시지 소비자(Consumer) (0) | 2019.02.18 |
---|---|
[JMS]Activemq 메시지 생성자(Producer) (0) | 2019.02.18 |
[기초 반복문] 1부터 10까지의 합계 (0) | 2019.01.13 |
[기초 반복문] 피라미드 만들기 (0) | 2019.01.13 |
[기초 반복문] 구구단 예제 (0) | 2019.01.13 |