91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

數(shù)據(jù)結(jié)構(gòu)課后作業(yè),和初學(xué)者分享同學(xué)好的代碼共同學(xué)習(xí)

資源截圖

代碼片段和文件信息

/*
?*代碼文件??GroupGoods.cpp
?*版本號:G1.0.111008
?*使用Visual?studio?2008?編譯
?*
?*由于時間倉促,未能進(jìn)行相關(guān)美化、優(yōu)化、測試工作
?*
?*參與編寫:李黎明,朱猛
?*網(wǎng)絡(luò)102小組公共資源,引用請注明出處
?*/

#include?“GroupGoods.h“


void?Put(?GoodsStack?&shelf?GoodsStack?&ground?GoodsGroup?&stream?);
bool?Again();
int?main()
{
GoodsStack?shelf(“貨架上“);
GoodsStack?ground(“地上“);
GoodsGroup?stream(“貨物流中“);
cout?< system(“pause“);
system(“cls“);
Put(?shelf?ground?stream?);
cout?< do{
Put(?shelf?ground?stream?);
}while(?Again()?);
system(“cls“);
cout< system(“pause“);
return?0;
}


void?GetStream(?GoodsGroup?&stream?);
void?LoadStream(?GoodsGroup?&stream?);
void?Tidy(?GoodsStack?&shelf?GoodsStack?&ground?GoodsGroup?&stream?);
//擺放貨物
void?Put(?GoodsStack?&shelf?GoodsStack?&ground?GoodsGroup?&stream?)
{
Error?streamE(“這都選得錯?“?“還是默認(rèn)幫你拉一批貨好了“?);
cout?< switch(?GetInt()?)
{
case?1:GetStream(?stream?);break;
case?0:LoadStream(?stream?);break;
default:streamE.ErrorTips();
LoadStream(?stream?);
}
cout?< Tidy(?shelf?ground?stream?);
stream.InitQ();
cout?< < shelf.Display();
system(?“pause“?);
system(?“cls“?);
}

//獲取貨物流
void?GetStream(?GoodsGroup?&stream?)
{
Goods?*?newG;
cout?< int?amount?=?GetInt();
for(?int?i?=?0;?i newG?=?new?Goods;
newG->goodsDate.GetDate();
stream.EnterQ(?newG?);
}
}

//加載默認(rèn)貨物流
void?LoadStream(?GoodsGroup?&stream?)
{
Goods?*?newG;
ifstream?fin?(?“example.txt“?ios::in?);
for(?int?i?=?0;?i? newG?=?new?Goods;
newG->goodsDate.ReadDate(?fin?);
stream.EnterQ(?newG?);
}
}

//整理
void?Tidy(?GoodsStack?&shelf?GoodsStack?&ground?GoodsGroup?&stream?)
{
while(?!stream.IsEmpty()?){ //貨物流非空時,循環(huán)執(zhí)行放貨操作
while(?!shelf.IsEmpty()?){ //貨架非空時,進(jìn)行日期判斷
//貨架頂商品日期早于貨物流頭商品時
if(?shelf.GetTop()->goodsDate.EarlyThan
(stream.GetHead()->goodsDate?))
ground.Push(?shelf.Pop()?); //將貨架的商品放到地上
else
break;
}
while(?!ground.IsEmpty()?){ //地面非空時,進(jìn)行日期判斷
//地上頂層商品日期不早于貨物流頭商品時
if(?!ground.GetTop()->goodsDate.EarlyThan
(stream.GetHead()->goodsDate?))
shelf.Push(?ground.Pop()?); //將地上的商品放到貨架
else
break;
}
shelf.Push(?stream.DeleteQ()?);
}
while(?!ground.IsEmpty()?) //把地上的商品全放回貨架
shelf.Push(?ground.Pop()?);
}

bool?Again()
{
do{
system(?“cls“?);
cout?< ?< switch(?GetInt()?)
{
case?0:return?false;
case?1:return?true;
case?2:system(?“cls“?);
cout<<“偷偷的告訴你,這個貨架是由最新的納米材料制成,“
???<<“應(yīng)用了相對論和量子論的高級原理,“
???<<“只要你和你的電腦扛得住,它就永遠(yuǎn)不會滿“< system(“pause“);
break;
default:return?false;
}
}while(1);
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????????39??2011-10-08?17:27??商品貨架\example.txt

?????文件???????1299??2011-10-08?21:45??商品貨架\GroupCommon.h

?????文件???????3344??2011-10-08?21:49??商品貨架\GroupGoods.cpp

?????文件???????3430??2011-10-08?21:24??商品貨架\GroupGoods.h

?????文件??????51712??2011-10-08?21:49??商品貨架\商品貨架管理.exe

?????目錄??????????0??2011-10-08?21:53??商品貨架

-----------?---------??----------?-----??----

????????????????59824????????????????????6


評論

共有 條評論

相關(guān)資源