Skip to content

Instantly share code, notes, and snippets.

/java_NTGFNw.java Secret

Created Aug 22, 2017
Embed
What would you like to do?
/* 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
You can’t perform that action at this time.