fork download
  1. class P21
  2. {
  3. public static void main(String[] args) throws Exception
  4. {
  5. int n=7;
  6. for (int i=0;i<n ;i++ )
  7. {
  8. for (int j=0;j<n ;j++)
  9. {
  10. Thread.sleep(150);
  11. if (i>=j && i+j>=n-1 || i<=j && i+j<=n-1)
  12. {
  13. System.out.print("* ");
  14. }
  15. else
  16. System.out.print(" ");
  17. }
  18. System.out.println();
  19. }
  20. }
  21. }
Success #stdin #stdout 0.1s 46820KB
stdin
Standard input is empty
stdout
* * * * * * * 
  * * * * *   
    * * *     
      *       
    * * *     
  * * * * *   
* * * * * * *