Just a sample

回答: 第一題說明亂彈2009-05-09 17:15:29

class hotel {

public:
........
void printUncleanedrooms();

private:
map &lt int, bool&gt _roomStatus;
list &lt int &gt _uncleanedRooms;

};

void hotel::printUncleanedrooms() {
for(list &lt int &gt::iterator iter=_uncleanedRooms.begin(); iter!= _uncleanedRooms.end();) {
if(_roomStatus[*iter])
_uncleanedRooms.erase(iter++);
else
cout }
}

所有跟帖: 

need to add "++iter" in the second case -亂彈- 給 亂彈 發送悄悄話 亂彈 的博客首頁 (0 bytes) () 05/10/2009 postreply 12:39:09

xiexie. -戲雨飛鷹- 給 戲雨飛鷹 發送悄悄話 戲雨飛鷹 的博客首頁 (0 bytes) () 05/10/2009 postreply 13:59:08

請您先登陸,再發跟帖!