0
寫入類LoopPractice。此類必須使用循環打印出以下 圖片。在主要方法中編寫代碼。 第一張圖片:使用循環在java中打印圖像/圖案
/ \\ /// \\\\ ///// \\\\\\ ///////
這是我到目前爲止的代碼:
for(int a=1; a<=7; a=a+2){
for(int i=1; i<=a; i++)
System.out.print("/");
System.out.println(" ");
for(int c=0; c<a; c=c+2)
System.out.print("\\\\");
System.out.println(" ");
}
但它打印一行8「\」結尾。在這種情況發生之前不應該終止循環?