* Output isosceles triangle with Java_

// Code ............................................... ................

java.util.Scanner Import;
public class WORK10 {
public static void main (String [] args) {
Scanner Scanner new new SC = (the System.in);
of System.out.print ( "Please enter an integer n-:");
int n = sc.nextInt ();

for (int i = 0;i <= n;i++){
for (int j = 1;j <= n-i;j++){
System.out.print(" ");
}
for (int k = 1;k <= 2*i-1;k++){
System.out.print("*");
}
System.out.println();
}
}
}

Guess you like

Origin www.cnblogs.com/a276665092/p/11914214.html