Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Drawing_With_Loops - created by borkins on 2017-04-01.
- */
- import java.util.Scanner;
- public class _07_ChristmasTree
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- StringBuilder stars = new StringBuilder();
- int n = Integer.parseInt(console.nextLine());
- for (int i = 0; i <= n; i++)
- {
- for (int j = i; j < n; j++) {
- System.out.print(" ");
- }
- System.out.println(stars + " | " + stars);
- stars.append("*");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement