Created
January 18, 2018 10:04
-
-
Save keehyun2/b0836a74fa134760226c375258657f59 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| public class Main{ | |
| public static void main(String args[]) throws NumberFormatException, IOException{ | |
| BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | |
| final int N = Integer.parseInt(br.readLine()); | |
| StringBuilder sb = new StringBuilder(); | |
| for (int i = 0; i < N; i++) { | |
| for (int j = 0; j < N ; j++) { | |
| if (j < i) { | |
| sb.append(" "); | |
| }else { | |
| sb.append("*"); | |
| } | |
| } | |
| sb.append("\n"); | |
| } | |
| System.out.println(sb); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment