[問題]draw a hollow square surrounded by stars

看板C_and_CPP (C/C++)作者 (Σ.﹒‧°★)時間16年前 (2009/03/21 14:28), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
這題目想了 幾小時 有點不了解 為什麼 這樣寫 哪位好心人 能指導一下方向 去解讀嗎? while ( row <= stars ) { column = 1; while ( column <= stars ) { if ( row == 1 ) cout << "*"; else if ( row == stars ) cout << "*";            else if ( column == 1 ) cout << "*"; else if ( column == stars ) cout << "*"; else cout << " "; column++; } // end inner while cout << endl; row++; thx . -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.47.194.53
文章代碼(AID): #19n8aTkm (C_and_CPP)
文章代碼(AID): #19n8aTkm (C_and_CPP)