Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Training;
- public class Main {
- public static void main(String[] args) {
- for (int i = 1; i <= 5; i++) {
- for (int j = 1; j <= 5 - i; j++) {
- System.out.print(" ");
- }
- System.out.print("*");
- for (int k = 1; k <= i * 2 - 3; k++) {
- System.out.print("-");
- }
- if (i > 1) {
- System.out.print("*");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement