All pastes #229659 Raw Edit

Unnamed

public text v1 · immutable
#229659 ·published 2006-10-30 21:01 UTC
rendered paste body
import java.io.* ;

class Tannenbaum 
{


  public static void main (String[] args)
  {
    int i, j;
    int hoehe;
    StdEingabe  instream_ref ;

    instream_ref = new StdEingabe ();
    hoehe = insteram_ref.liesInteger ( "Anzahl der Zeilen: " );


    for (i=1; i<=hoehe; i++) {

      for (j=1; j<=hoehe-i; j++)
        System.out.print(" ");

      for (j=1; j<=(2*i-1); j++)
        System.out.print("*");

      System.out.println();
    }

    // noch "Stamm" einzeichnen
    for (i=1; i<hoehe; i++)
      System.out.print(" ");
    System.out.println("I");

  }

}