코드
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args){ | |
Scanner sc=new Scanner(System.in); | |
int a = sc.nextInt(); | |
String b="*"; | |
int cnt= 0; | |
for(int i=0; i<a; i++) { | |
cnt++; | |
for(int j=0; j<cnt; j++) { | |
System.out.print(b); | |
} | |
System.out.println(); | |
} | |
} | |
} |
'백준 알고리즘 > JAVA' 카테고리의 다른 글
[JAVA 자바] 백준 1193번 분수찾기 (0) | 2018.07.11 |
---|---|
[JAVA 자바] 백준 2292번 벌집 (0) | 2018.07.10 |
[JAVA 자바] 백준 1157번 단어 공부 (0) | 2018.07.10 |
[JAVA 자바] 백준 2675번 문자열 반복 (0) | 2018.07.09 |
[JAVA 자바] 백준 10809번 알파벳 찾기 (0) | 2018.07.09 |