freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

[計(jì)算機(jī)軟件及應(yīng)用]c++上機(jī)實(shí)習(xí)題-文庫吧

2025-01-03 04:09 本頁面


【正文】 cout_sexyendl。 cout_ageendl。 } int same(int age) { if(age==_age)return 1。 return 0。 }}。class LinkedList{public: node *Node。 LinkedList *next。 LinkedList(int num,int age,string name,string sexy) { Node=new node(num,age,name,sexy)。 next=NULL。 }}。int main(void){ int num,age。 string name,sexy。 cinnumnamesexyage。 LinkedList head(num,age,name,sexy)。 LinkedList *p=amp。head。 for(int i=1。 i=4。 i++) { cinnumnamesexyage。 pnext=new LinkedList(num,age,name,sexy)。 p=pnext。 } cinage。 LinkedList *pp=amp。head。 int flag=0。 while(pp!=NULL) { if(ppNodesame(age))flag++。 else ppNodedisplay()。 pp=ppnext。 } if(!flag) { node n(180,age,aaa,male)。 ()。 } return 0。}示例代碼include iostreaminclude cstringusing namespace std。const int MAX_STR_LEN = 32。struct StuNode{ int ID。 char name[MAX_STR_LEN]。 char gender[MAX_STR_LEN]。 int age。 struct StuNode *next。}。typedef struct StuNode *StuLink。 void CreateHeadNode(StuLink amp。pHead, StuLink amp。pTail){ pHead = new StuNode。 if (pHead == NULL) return。 pHeadnext = NULL。 pTail = pHead。} void AddStudent(StuLink amp。pTail, StuNode data){ StuLink p。 p = new StuNode。 if (p == NULL) return。 pID = 。 strcpy(pname, )。 strcpy(pgender, )。 page = 。 pnext = NULL。 //Make the current node pointer point to the last added data pTailnext = p。 pTail = p。} bool RemoveStudent(StuLink amp。pHead, StuLink amp。pTail, int age){ bool bFind=false。 StuLink pCurr, pPre。 pPre = pHead。 //Skip to the second node because the first node is the head node without data pCurr = pHeadnext。 while (pCurr != NULL) { if (pCurrage == age) { pPrenext = pCurrnext。 delete pCurr。 //Recover the current pointer to find the next node that has the same key pCurr = pPrenext。 bFind=true。 } else { //Move to the next node pPre = pCurr。 pCurr = pCurrnext。 } } //Recover the tail pointer in case the last node is deleted if(bFind amp。amp。 pPrenext==NULL) pTail = pPre。 return bFind。} void OutputAllStudentsInfo(const StuLink pHead){ StuLink p。 //Skip to the second node because the first node is the head node without data p = pHeadnext。 if (p == NULL) return。 while (p != NULL) { cout pID endl。 cout pname endl。 cout pgender endl。 cout page endl。 p = pnext。 }}void InputStudentInfo(StuNode amp。Emp){ cin 。 while ( =200 || 100 || strlen()=20 || strlen()=10 || 0 || =200) { cin 。 }}int main(){ StuLink EmpInstHead, EmpInstTail。 StuNode EmpTemp。 int i, age。 //Create a head node for the linked list CreateHeadNode(EmpInstHead, EmpInstTail)。 for (i=0。 i5。 i++) { InputStudentInfo(EmpTemp)。 AddStudent(EmpInstTail, EmpTemp)。 } cin age。 //Remove a head node from the linked list if(!RemoveStudent(EmpInstHead, EmpInstTail, age)) { = age。 =180。 strcpy(, aaa)。 strcpy(, male)。 =NULL。 AddStudent(EmpInstTail, EmpTemp)。 } OutputAllStudentsInfo(EmpInstHead)。 return 0。} 實(shí)驗(yàn)題目(共4題, 第1題)標(biāo)題: 1. 函數(shù)重載 時(shí) 限: 1000 ms 內(nèi)存限制: 10000 K 總時(shí)限: 3000 ms 描述: 設(shè)計(jì)一菜單程序,利用函數(shù)重載實(shí)現(xiàn)員工月工資的計(jì)算,計(jì)算方法如下: (1)管理人員的月工資 = 月薪 - 缺勤天數(shù) 月薪 247。 22; (2)銷售人員的月工資 = 底薪 + 銷售金額 提成比例; (3)計(jì)件工人的月工資 = 產(chǎn)品件數(shù) 每件報(bào)酬; (4)計(jì)時(shí)工人的月工資 = 工作小時(shí) 小時(shí)報(bào)酬; 輸入: 職工類別及相關(guān)信息。職工類別:1表示管理人員;2表示銷售人員;3表示計(jì)件工人;4表示計(jì)時(shí)工人;其余字符表示退出。相關(guān)信息:若為管理人員,則輸入月薪和缺勤天數(shù);若為銷售人員,則輸入底薪、銷售金額和提成比例;若為計(jì)件工人,則輸入產(chǎn)品件數(shù)和每件報(bào)酬;若為計(jì)時(shí)工人,則輸入工作小時(shí)和小時(shí)報(bào)酬。 輸出: 員工月工資。 輸入樣例: 1 〈--職工類別 1〈--月薪和缺勤天數(shù) 輸出樣例: 提示: 1. 計(jì)算管理人員、銷售人員、計(jì)件工人、計(jì)時(shí)工人的月工資的函數(shù)原型可以分別設(shè)計(jì)如下: double getEarning(double salary, int absenceDays)。 double getEarning(double baseSalary, double salesSum, double rate)。 double getEarning(int workPieces, double wagePerPiece)。 double getEarning(double hours, double wagePerHour)。2. 菜單程序設(shè)計(jì)如下: int main(){ ... cout Please select... endl。 cout 1: Manager. endl。 cout 2: Sales Man. endl。 cout 3: Pieces Worker. endl。 cout 4: HourWorker. endl。 cout Others: Quit endl。 cin sel。 switch(sel) { case 1: cin ...。 cout getEarning(...)。 break。 case 2: cin ...。 cout getEarning(...)。 break。 case 3: cin ...。 cout getEarning(...)。 break。 case 4: cin ...。 cout getEarning(...)。 break。 default: break。 } return 0。} include iostreamusing namespace std。double getEarning(double salary,int absenceDays){ return salaryabsenceDays*salary/22。}double getEarning(double baseSlary,double salesSum,double rate){ return baseSlary+salesSum*rate。}double getEarning(int workPieces,double wagePerPiece){ return workPieces*wagePerPiece。}double getEarning(double hours,double wagePerHour){ return hours*wagePerHour。}int main(){ double salary,baseSalary,salesSum,rate,hours,wagePerHour,wagePerPiece。 int absenceDays,workPieces,sel。 cout Please select... endl。 cout 1: Manager. endl。 cout 2: Sales Man. endl。 cout 3: Pieces Worker. endl。 co
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1