Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Tannenbaum {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- System.out.println("Bitte geben Sie die hoehe ein :)");
- int hoehe = scanner.nextInt();
- for(int i=0;i<hoehe; i++)
- {
- for(int j=0;j<hoehe -1 -i ; j++)
- {
- System.out.print(" ");
- }
- for(int k=0; k<i*2+1;k++)
- {
- System.out.print("*");
- }
- System.out.println("");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement