close


最近發現有些作業好像滿常出現的

*****
****
***
**
*

想起以前寫這題目時

Control print under double loop.

for(...)
{
    for(...)
       cout<< "*";
    cout << "endl"
}

不過現在去寫大概會這樣寫吧

cout.fill('*');
for(...)
{
    cout.width(n);
    cout << '*' << endl;
}

不過其實沒什麼差,

我只是想說:

隨著時間改變,

或許對一個程式的看法有所不同,

寫法有所不同,

但是想起之前讀演算法上所說的,

能在時間內達成目標的方法,

就是好方法.
arrow
arrow
    全站熱搜

    grant823 發表在 痞客邦 留言(0) 人氣()