Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class test
- {
- public static void main(String args[])
- {
- System.out.print("Poso megalo se ipsos: ");
- int ipsos = UserInput.getInteger();
- int rows = 1, stars = 1, platos = ipsos + (ipsos + 1);
- System.out.println();
- while(ipsos >= rows)
- {
- for(int i = 0; i < platos; i++)
- {
- /*if(i > (platos / 2) - stars && i < (platos / 2) + stars)
- {
- System.out.print("*");
- }
- else
- {
- System.out.print(" ");
- }*/
- System.out.print((i > (platos / 2) - stars && i < (platos / 2) + stars) ? "*" : " ");
- }
- System.out.println();
- rows++;
- stars++;
- }
- for(int j = 0; j < 2; j++)
- {
- for(int k = 0; k < platos; k++)
- {
- /*if(k >= (platos / 2) - 1 && k <= (platos / 2) + 1)
- {
- System.out.print("*");
- }
- else
- {
- System.out.print(" ");
- }*/
- System.out.print((k >= (platos / 2) - 1 && k <= (platos / 2) + 1) ? "*" : " ");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement