Skip to content

Instantly share code, notes, and snippets.

Created August 22, 2017 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/89902218c97365439a0ca5ce346516f0 to your computer and use it in GitHub Desktop.
Save anonymous/89902218c97365439a0ca5ce346516f0 to your computer and use it in GitHub Desktop.
/* Pyramid No.1 from 36 style */
public class pyramid01 {
public static void main(String args[]) {
int totalLine = 4;
for (int row=1; row <= totalLine; row++) {
for (int col=2; col <= row; col++) { System.out.print(" "); }
System.out.print(row + "" + row);
for (int col=totalLine; col >= (row + 1); col--) { System.out.print("**"); }
System.out.println( row + "" + row);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment