-
-
Save anonymous/89902218c97365439a0ca5ce346516f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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