• Source
    1. import java.util.Scanner;
    2. public class Main{
    3. public static void main(String args[]){
    4. Scanner sc = new Scanner(System.in);
    5. int n = sc.nextInt();
    6. if(n>=1&&n<=100){
    7. for(int i=n;i>=1;i--){
    8. for(int j=1;j<n;j++){
    9. System.out.print(" ");
    10. }
    11. for(int k=n;k>=i;k--){
    12. System.out.print("*");
    13. }
    14. System.out.println();
    15. }
    16. }
    17. sc.close();
    18. }
    19. }