fork download
  1. class Main {
  2. public static void main (String[] args) {
  3. int altura = 5;
  4. int largura = 5;
  5. for (int j = 0; j < largura; j++) System.out.print("* ");
  6. System.out.print("\n");
  7. for (int i = 2; i < altura; i++) {
  8. System.out.print("* ");
  9. for (int j = 2; j < largura; j++) System.out.print(" ");
  10. System.out.print("* \n");
  11. }
  12. for (int j = 0; j < largura; j++) System.out.print("* ");
  13. }
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/420189/101
Success #stdin #stdout 0.06s 32152KB
stdin
Standard input is empty
stdout
* * * * * 
*       * 
*       * 
*       * 
* * * * *