[問題]draw a hollow square surrounded by stars
看板C_and_CPP (C/C++)作者TikalCelts (Σ.﹒‧°★)時間16年前 (2009/03/21 14:28)推噓0(0推 0噓 0→)留言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
討論串 (同標題文章)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章