משולש הפוך

int
size
;

System.out.println("please insert size");

size =
reader
.nextInt();        

for
(
int row=0;row<size;row
++)
{

     //
הדפסת
הרווחים

     int
spaces
=
size-1-row
;

     for
(
int col = 0;col< spaces;col
++)
{

          System.out.print("_");

     }

     //
הדפסת הכוכביות
         

     for
(
int col =0;col<sizespaces;col
++)
{

          System.out.print("*");

     }                      

     System.out.println();

}