聽演講很無聊,就印了一個聖誕樹,聖誕節快樂!~~!
*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
*********************
*
*
*
*
(還是在compiler印出來比較好看= =)
================== source code ===================
public class Main{
public static void main(String[] args) {
for(int i = 0; i<=10; i++){
for(int j = -10; j<= 10; j++)
if(Math.abs(j)<=(0+i))
System.out.print("*");
else
System.out.print(" ");
System.out.println("");
}
for(int i = 0; i<=3; i++){
for(int j = -10; j<= 10; j++)
if(j==0)
System.out.print("*");
else
System.out.print(" ");
System.out.println("");
}
}
}
沒有留言:
張貼留言