【正文】
s feud with Nezha over his son39。s recall these colorful images that brought the country great joy. Calabash Brothers Calabash Brothers (Chinese: 葫蘆娃 ) is a Chinese animation TV series produced by Shanghai Animation Film Studio. In the 1980s the series was one of the most popular animations in China. It was released at a point when the Chinese animation industry was in a relatively downed state pared to the rest of the international munity. Still, the series was translated into 7 different languages. The episodes were produced with a vast amount of papercut animations. Black Cat Detective Black Cat Detective (Chinese: 黑貓警長 ) is a Chinese animation television series produced by the Shanghai Animation Film Studio. It is sometimes known as Mr. Black. The series was originally aired from 1984 to 1987. In June 2021, a rebroadc asting of the original series was announced. Critics bemoan the series39?!?,要求遞歸求出數(shù)組 a中所有 n個元素之積并返回。 3. double SF(double x, int n) { //n為大于等于 0的整數(shù) double p=1,s=1。 return a。 =1235。 delete[]b。i++) a[i]=3*i+1。 int *p=a。 coutendl。c39。B39?!闭Z句時,將自動調(diào)用該類的 __析構(gòu)函數(shù) __。 5.若 x=5,y=15,則 xy的邏輯值為 __假( false 或 0) _。 C. int amp。 j++) S。 5. C++語言中的每條簡單語句以 ___B_____作為結(jié)束符。 D. int a[5]。 a[i]=a[n1i]。in。 m) { float s=0。 } 函數(shù)功能: 求出從鍵盤上輸入的 n個整數(shù)的平方和并返回。 39。 i++) { if(i%3==0) s+=a[i]。 y=x+y。 } 運行結(jié)果: 26 14 2. include include void main() { char* a[5]={student,worker,cadre,soldier,apen}。} } } void main() { int x=20, y=6。 三、寫出下列每個程序運行后的輸出結(jié)果(每小題 6分,共 30 分) 1. include include int SD(int a, int b, char op) { switch(op) { case 39。 5. 假定一個二維數(shù)組的定義為“ int a[3][6]。)。 D. int BC(int a, int b=0)。 C. int a[]。 A. 1 B. 0 C. 與 x值相同 D. 與 x值相反 4. for語句能夠被改寫為( D )語句。 i) { couta[i]’ ’。 in。 //sqrt(x)為求 x的平方根 int i=2。ppay300endl。 39。 //年齡 float pay。in。 i8。 } 輸出結(jié)果: s=84 2. include void main() { int i=1,s=0。 8. 假定要訪問一個結(jié)構(gòu)指針 p所指對象中的數(shù)據(jù)成員 data,則表示方法為 _ pdata _。 b!=15____。Z39。 B. BOOK x={C++ Programming,}。 A. strlen() B. strcpy() C. strcat() D. strcmp() 8. 預處理命令在程序中都是以 ( B )字符開頭的。 int y)。 } 5 訓練第二套 一、單選題(每小題 2分,共 20分) 1. 枚 舉類型中的每個枚舉常量的值都是一個( A )值。b=36。 return f。 3. 假定結(jié)構(gòu)類型 Dnode中的 data域為結(jié)點值域, next域為結(jié)點指針 域。 return false。 int* p=a。 couta39。 coutmendl。 cout”c=”cendl。} couts139。 9.假定一維數(shù)組的定義為“ int a[8]。 6. 對于在所有函數(shù) 定 義 之外定義的變量,若沒有被初始化則系統(tǒng)隱含對它賦予的初值為 ___0_____。 A. ios::in B. ios::out C. ios::in | ios::out D. 沒有 二、填空題(每小題 2分,共 20分) 1. 若需要定義一個標識符常量,并且使 C++能夠進行類型檢查,則應在定義語句的開始使用保留字 __ const __。 A. char a[20]=”abcdefg”。 A. x=0 || y!=5 B. x=0 amp。amp。 A. 1 B. 2 C. 4 D. 8 5. 枚舉類型 中的每個枚舉常量的值都是一個( A )。 A. 數(shù)組的首地址 B. 數(shù)組中第一個元素的值 C. 數(shù)組全部元素的值 D. 數(shù)組元素的個數(shù) 9.假定 AB為一個類,則執(zhí)行“ AB a(4), b[5], *p[2]。 4. 每個字符指針變量占用內(nèi)存 __4____個字節(jié)。 A* c。 i=6。 for(int i=0。i++) for(int j=0。 39。 39。 } 輸出結(jié)果: 6 4 5 四、寫出下列每個函數(shù)的功能(每小題 8分,共 24分) 1. bool WB(int a[], int n, int x) { for(int i=0。i++) if(a[i]a[k]) k=i。 while(n) { p=pnext=new DNode。 for(a=6。b39。 B. BC(int, int)。 i++) if(in/2) {coutiendl?!?,則不正確的變量定義語句為( D )。 A. 1 B. n C. n1 D. n+1 二、填空題(每小題 2分,共 20分) 1.已知 39。 3. 表達式 x=x+1表示成增量表達式為 _____++x _____。 A* c。i=8。 int b1, b2。b2endl。 coutLB(a,5)endl。 p=amp。 39。 return c。 } 函數(shù)功能: 判斷 x是否為一個素數(shù)(或質(zhì)數(shù)),若是則返回真,否則返回 假。 答: void Print(int a[], int n) { int i,j=0。 A. 空格或逗號 B. 逗號或回車 C. 逗號或分號 D. 空格或回車 3. 設 x是一個 bool型的邏輯量, y的值為 10,則表達式 x amp。 A. 4 B. 3 C. 5 D. 2 6. 在下面的一維數(shù)組定義中,( C )語句有語法錯誤。 A. int BC(int x, int y)。 B. AB(AB x)。 2. 在 C++每個程序行的后面或單獨一行的開始使用注釋的標記符為 ____//____。 8. 假定 a是一個一維數(shù)組,則 a[i]的指針訪問方式為 __*(a+i)__。: return ab。SD(x,y,39。i++) { if(strcmp(a[i], p1)0) p1=a[i]。 int s=0。i5。 y+=x*x。 return false。 s/=n。 答: void AD(int a[], int n) { for(i=0。 A. int a[]={1,2,3}。 C. int a[]={1,5,10,45}。 in。m?!保瑒t ac的值為 ___1____。 9. 假定要動態(tài)分配一個類型為 Worker 的具有 n 個元素的數(shù)組,并由 r 指向這個動態(tài)數(shù)組,則使用的 語句為Worker* r=___ new Worker[n]。: coutwell!’ ’。 case 39。 } } v