【正文】
CAT()。CAT)。 int GetAge(){ return *itsAge。 } protected: int * itsAge。 CAT::CAT() { itsAge=new int。 } CAT::~CAT() { delete itsAge。 } int main() { 專業(yè)好文檔 5 CAT a。s age:()endl。 CAT b(a)。s age:()endl。s age:()endl。 couta39。 coutb39。 } 運(yùn)行結(jié)果: a39。s age:6 b39。s age:7 b39。 三、閱讀下列程序及說明和注釋信息,在方框中填寫適當(dāng)?shù)某绦蚨危钩绦蛲瓿芍付ǖ墓δ? 程序功能說明 :從鍵盤讀入兩個(gè)分別按由小到大次序排列的整數(shù)序列,每個(gè)序列 10 個(gè)整數(shù),整數(shù)間以空白符分隔。然后將兩個(gè)鏈表合成為一個(gè)新的鏈表,新鏈表的結(jié)點(diǎn)數(shù)據(jù)仍然按由小到大次序排列。 程序運(yùn)行結(jié)果 如下,帶下劃線部分表示輸入內(nèi)容,其余是輸出內(nèi)容: 1 3 5 7 9 11 13 15 17 19 2 4 6 8 10 12 14 16 18 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 include include //類定義部分 template class T class Node { private: NodeT *next。 //數(shù)據(jù)域 Node (const Tamp。 // 構(gòu)造函數(shù) void InsertAfter(NodeT *p)。 //刪除本節(jié)點(diǎn)的后繼節(jié)點(diǎn) ,返回其地址 NodeT *NextNode(void) const。 專業(yè)好文檔 6 template class T class LinkedList { private: NodeT *front, *rear。 //記錄表當(dāng)前遍歷位置的指針 ,由插入和刪除操作更新 int size。 // 當(dāng)前元素在表中的位置序號(hào)。 item,NodeT *ptrNext=NULL)。 //釋放節(jié)點(diǎn) void CopyList(const LinkedListTamp。 // 將鏈表 L 拷貝到當(dāng)前表 //(假設(shè)當(dāng)前表為空)。 // 構(gòu)造函數(shù) LinkedList(const LinkedListTamp。 //拷貝構(gòu)造函數(shù) ~LinkedList(void)。 operator= (const LinkedListTamp。//重載賦值運(yùn)算符 int ListSize(void) const。 //size 為 0時(shí)返回 TRUE,否則返回 FALSE void Reset(int pos = 0)。 //使 prevPtr 和 currPtr 移動(dòng)到下一個(gè)節(jié)點(diǎn) int EndOfList(void) const。 //返回?cái)?shù)據(jù)成員 position void InsertFront(const Tamp。 //在表頭插入一個(gè)數(shù)據(jù)域?yàn)?item的節(jié)點(diǎn) void InsertRear(const Tamp。 //在表尾添加一個(gè)數(shù)據(jù)域?yàn)?item的節(jié)點(diǎn) void InsertAt(const Tamp。 //在當(dāng)前節(jié)點(diǎn)之前插入一個(gè)數(shù)據(jù)域?yàn)?item的節(jié)點(diǎn) void InsertAfter(const Tamp。 //在當(dāng)前節(jié)點(diǎn)之后插入一個(gè)數(shù)據(jù)域?yàn)?item的節(jié)點(diǎn) T DeleteFront(void)。 //刪除當(dāng)前節(jié)點(diǎn) ,釋放節(jié)點(diǎn)空間,更新 prevPtr、 currPtr 和 size Tamp。 // 返回對(duì)當(dāng)前節(jié)點(diǎn)成員 data 的引用 void ClearList(void)。 }。 //函數(shù)結(jié)束后,程序的數(shù)據(jù)所占內(nèi)存空間總數(shù)不因此函數(shù)的運(yùn)行而增加。amp。 laDeleteAt()。 lbDeleteAt()。 laDeleteAt()。 lbDeleteAt()。 int item, i。i 10。 (item)。 //讀如數(shù)據(jù)建立鏈表 lb for (i=0。i++) { 專業(yè)好文檔 8 cinitem。 } ()。la, amp。lc)。 // 輸出各節(jié)點(diǎn)數(shù)據(jù),直到鏈表尾 while(!()) { cout () 。 // 使 currPtr 指向下一個(gè)節(jié)點(diǎn) } cout endl。s National Basketball Association (WNBA) playoffs. And it has also made American heroes out of its player and coach legends like Michael Jordan, Larry Bird, Earvin Magic Johnson, Sheryl Swoopes, and other great players. At the heart of the game is the playing space and the equipment. The space is a rectangular, indoor court. The principal pieces of equipment are the two elevated baskets, one at each end (in the long direction) of the court, and the basketball itself. The ball is spherical in shape and is inflated. Basketballs range in size from in (7276 cm) in circumference, and in weight from 1822 oz (510624 g). For players below the high school level, a smaller ball is used, but the ball in men39。s ball is in (7274 cm) in circumference. The covering of the ball is leather, rubber, position, or synthetic, although leather covers only are dictated by rules for college play, unless the teams agree otherwise. Orange is the regulation color. At all levels of play, the home team provides the ball. Inflation of the ball is based on the height of the ball39。s Christian Association (YMCA), which later became Springfield College. Naismith (18611939) was a physical education teacher who was seeking a team sport with limited physical contact but a lot of running, jumping, shooting, and the handeye coordination required in handling a ball. The peach baskets he hung as goals gave the sport the name of basketball. His students were excited about the game, and Christmas vacation gave them the chance to tell their friends and people at their local YMCAs about the game. The association leaders wrote to Naismith asking for copies of the rules, and they were published in the Triangle, the school newspaper, on January 15,1892. Naismith39。 the ball was the objective. To score, the ball had to be shot through a horizontal, elevated goal. The team with the most points at the end of an allotted time period wins. Early in the history of basketball, the local YMCAs provided the gymnasiums, and membership in the anization grew rapidly. The size of the local gym dictated the number of players。s original players were Canadians, and the game spread to Canada immediately. It was played in France by 1893。 Australia, China, and India between 1895 and 1900。 its construction and size of 30 in (76 cm) were ruled official in 1949. The rulesetters came from several groups early in the 1900s. Colleges and universities established their rules mittees in 1905, the YMCA and the Amateur Athletic Union (AAU) created a set of rules jointly, state militia groups abided by a shared set of rules, and there were two professional sets of rules. A Joint Rules Committee for colleges, the AAU, and the YMCA was created in 1915, and, under the name the National Bas