PCDVD數位科技討論區

PCDVD數位科技討論區 (https://www.pcdvd.com.tw/index.php)
-   七嘴八舌異言堂 (https://www.pcdvd.com.tw/forumdisplay.php?f=12)
-   -   請問一個三角型 java的問題 (https://www.pcdvd.com.tw/showthread.php?t=556469)

Balenciaga 2005-11-06 10:33 PM

請問一個三角型 java的問題
 
以下是三角型java的語法
public class 3 {
public static void main(String args[])
{
int a=5;
for(int i=0;i<a;i++){
for(int j=0;j<a-i;j++) System.out.print(" ");
for(int k=0;k<2*(i+1)-1;k++) System.out.print("*");
System.out.println("");
}
}
}
請問要怎樣才能改成倒三角,左三角,右三角呢
改了好久還是改不出來 :cry: :cry: :cry:


所有的時間均為GMT +8。 現在的時間是07:08 AM.

vBulletin Version 3.0.1
powered_by_vbulletin 2025。