本帖最後由 李泳霖 於 2022-6-27 18:58 編輯
利用巢狀回圈, 將符號*整齊排列成如下之三角形:
 - public class Ch19
- {
- public static void main(String args[])
- {
- for(________________)
- {
- for(________________)
- System.out.print(" ");
- for(________________)
- System.out.print("*");
- System.out.println();
- }
- }
- }
複製代碼- //++++*
- //+++***
- //++*****
- //+*******
- //*********
複製代碼 |