-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ2523.java
More file actions
28 lines (25 loc) · 910 Bytes
/
Q2523.java
File metadata and controls
28 lines (25 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Date: 04/11/2018
* Author: inhyuck | https://github.com/inhyuck
* Solution URL: https://github.com/inhyuck/problem-solving
* Title: 별찍기 - 13
* description: 예제를 보고 별찍는 규칙을 유추한 뒤에 별을 찍어 보세요.
* Solution Key: -
* Problem URL: https://www.acmicpc.net/problem/2523
*/
package io.inhyuck.io;
import java.util.Scanner;
public class Q2523 {
public static void main(String[] args) {
int n = new Scanner(System.in).nextInt();
StringBuilder tempBuilder = new StringBuilder();
StringBuilder resultBuilder = new StringBuilder();
for (int i = 0; i < n; i++) {
resultBuilder.append(tempBuilder.append("*")).append("\n");
}
for (int i = 0; i < n - 1; i++) {
resultBuilder.append(tempBuilder.deleteCharAt(0)).append("\n");
}
System.out.println(resultBuilder);
}
}