import java.util.*;
import java.lang.*;
import java.io.*;
/*for output patter
* * * * * * * *
* * * * * * *
* * * * * *
* * * * *
* * * *
* * *
* *
*
*/;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
//System.out.println("Hello world!");
Scanner scn = new Scanner(System.in);
//int n = scn.nextInt();
int n = 8;
int row = 1;
while (row<= n){
int space = 1;
while (space <= row-1) {
System.out.print(" ");
space++;
}
int star = 1;
while (star <= n +1 -row )
{
System.out.print("* ");
star++;
}
row++;
System.out.println();
}
//row = row-1;
//space = " " ;
//n = n-1;
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: