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

正文內(nèi)容

電大本科c語言程序設(shè)計(jì)期末復(fù)習(xí)試題及答案參考資料小抄【精編打印版-文庫吧資料

2025-06-13 22:14本頁面
  

【正文】 turn a b。 case 39。+39。op = ch。 public: A(int aa, int bb, char ch){a = aa。} 運(yùn)行結(jié)果 : DestructorB! 7 7 Destructor A! 6 Destructor B! 0 Destructor A! 5 8. include include class A{ int a,b。}}。 public: B(int aa= 0, int bb= 0): A(aa){b = bb。}}。 public: A(int aa= 0){a = aa。 void main(){ B x(2,3),y(4,5)。 public: B(int aa, int bb): A(aa), b(bb){ cout”Constructor B! ” bendl。}}。} 運(yùn)行結(jié)果 : Constructor! 9 Constructor! 12 Destructor! Destructor! 31. include class A{ int a。 p = new A(12)。}}。} ~A(){delete a。 public: A(int x){ a = new int(x)。 delete p。 void main(){ A x(5)。 public: A(int aa= 0): a(aa){} ~A(){cout”Destructor! ” a endl。 delete p。 void main(){ A x[2]。 cout”Constructor! ” * aendl。} 運(yùn)行結(jié)果 : Constructor! 0 Constructor! 7 28. include class A{ int * a。}}。} 運(yùn)行結(jié)果: 6 3 8 10 27. include class A{ int a, b。}}。 b=bb。 public: A( ) {a=b=0。 cout x. name ?? ?? x. payendl。 x. age = d。float f =725。 char * t =”liouting”。 //工資 }。 //姓名 int age。 ppay10endl。 page+5 39。 cout pname 39。x。 y = x。 void main(){ Worker x ={”weirong”,55,640}。 //年齡 float pay。} 運(yùn)行結(jié)果: 3 5 7 9 11 11 9 7 5 3 6 24. include struct Worker{ char name[15]。} coutendl。i++){ coutsetw(5)d[i] 39。 for(i = 0。} coutendl。 coutsetw(5)d[i] 39。i5。 int i。p。 * p = x。 while(ap){ int x = * a。 delete[ ]p。 i++) cout p[i] ? ?。 for(int i = 0。 // a[0]=1 a[1]=3 a[2]=5 a[3]=7 a[4]=9} void main(){ int * p, n =5。im。 int * p = a。 a, int amp。 cout”x =” x ”,y =” y endl。 cout”x =” x ”,y =” y endl。 // y = 13 + 8 = 21 cout”x =” x ”,y =” y endl。 x, int y){ // 引用形參 x 按地址傳遞,形參 y 按值傳遞 x = x + y。cout x ? ? y endl。} void main(){ int x =15,y =36。b = x。} 運(yùn)行結(jié)果: 75 45 165 20. include void LC(int a,int b){ // 參數(shù)按值傳遞 int x = a。 39。 39。 int c =LA(a+3,2)。} void main(){ int a[ ]={5,10,15,20,25,30}。i++) s += a[i]。 for(int i =0。 y endl。cout x 39。cout *pendl。 // x = x + 10 = 30 p =amp。 39。x。} 運(yùn)行結(jié)果: 4 16 28 18. include void main(){ int x=20,y=40, *p。 }while(pa+8)。 39。 int *p = a。 coutendl。i5。 coutendl。i5。 int *p = a。 if((i +1)%4 ==0)coutendl。i8。 int *p = a。 b endl。 } cout a 39。 39。 int b = a +35。 b endl。 cout a 39。 a[ii][jj]endl。 jj 39。} // m:最大值;最大值行號 ii、列號 jj cout ii 39。ii=i。j4。i3。 int ii =0,jj =0。} 運(yùn)行結(jié)果: 2 1 6 1 13. include void main(){ int a[3][4] = {{1,2,7,8},{5,6,11,12},{24,10,3,4}}。 39。i4。 c[j]++。i++){ int j = 0。 for(int i=0。 int b[4] = {60,70,90,101}。 coutendl。i++)coutb[i]39。 } for(i=0。 default : b[4]++。 : b[3]++。 case 39。 : b[2]++。 case 39。 : b[1]++。 case 39。 : b[0]++。 while(a[i]){ switch(a[i]){ case 39。} 運(yùn)行結(jié)果: 7 3 11. include void main(){ char a[ ]= abcdabcdbdaeaf。 39。 i ++。b39。) i1++。 while(a[i]){ if(a[i] = = 39。 } 運(yùn)行結(jié)果: 73 36 10. include void main(){ char a[]= aabcdaabacabfgacd。 39。 b1=a[i]。i8。 b1=b2=a[0]。} 運(yùn)行結(jié)果: worker apple 9. include void main( ) { int a[8]={36,73,48,14,55,40,32,66}。 39。//p1:最大; p2:最小 if(strcmp(a[i],p2)0) p2=a[i]。i5。 p1=p2=a[0]。} 運(yùn)行結(jié)果: 4 2 4 8. include include void main( ){ char *a[5]={student,worker,cadre,apple,peasant}。 39。 39。 // a[ i ] = 55 , 40 case 2: i2++。 //a[ i ] = 12 , 39 , 63 , 72 case 1: i1++。i++) switch(b=a[i]%3) { case 0: i0++。 for(int i=0。 int b。} // 循環(huán) 10 次 y增加 20 cout ”y*y=”y*yendl。 while (n){y++。 // s2= 0+2+4+6+8 cout s1? ?s2endl。I++) if (I%2) s1+=I。 for (int I=0。 // s=3+6+9+12+15+18 } cout ”I,s=”I”,”sendl。I++){ if (s50) break。} 運(yùn)行結(jié)果: s=55 include void main ( ){ int s=0。I++) s+=I*I。 for (int I=1。 cout SD(x+y,y2,?/?)endl。 cout SD(x,y,??)? ?。 } return x。 break。 case ?/?:if (b) x=double (a)/b。 case ?*?: x=double (a) * b。 case ??: x=double (a)– b。 //局部變量 x的改變不影響 main函數(shù)中的 x switch (op) { case ?x?:x=double(a) + b。 Cout endl。SB(a3)。 SB(al)。 break。break。break。 三 、寫出下列程序運(yùn)行后的輸出結(jié)果 1. include void SB (char ch) { switch (ch) { case ?A? :case ?a?: cout ”well”!” 。 ifstream 流類定義一個(gè)流對象并打開一個(gè)磁盤文件時(shí),文件的隱含打開方式為 ios :: in,當(dāng)使用 ofstream 流類定義一個(gè)流對象并打開一個(gè)磁盤文件時(shí),文件的隱含打開方式為 ios::out 。 程序 文件中進(jìn)行文件輸入輸出操作,則必須在開始的 include 命令中使用 頭文件。 C++流類庫中,輸入流類和輸出流類的名稱分別為 istream 和 ostream 。 。 operator+(AB amp。 直接 訪問該類的 私有成員 。 賦值語句 或 初始化表 完成的。 )。 n 個(gè)字節(jié)的儲(chǔ)存空間時(shí),它所能儲(chǔ)存字符串的最大長度為 n- 1 。 AB 中有一個(gè)靜態(tài) 整型成員 bb,在類外的它進(jìn)行定義并初始化為 0時(shí),所使用寫法為: int AB:: bb = 0 ; 。 ”定義為一個(gè)類 AB的友元函數(shù),則應(yīng)在類 AB 的定義中加入一條語句: friend void f( ); 。 AB 的類定義析構(gòu)函數(shù),則系統(tǒng)為其隱含定義的析構(gòu)函數(shù)為 ~ AB ( ) { } ?!闭Z句時(shí),系統(tǒng)自動(dòng)調(diào)用該類構(gòu)造函數(shù)的次數(shù)為 10 。 A[N],當(dāng)離開它的作用域時(shí),系統(tǒng)自動(dòng)調(diào)用該類析構(gòu)函數(shù)的次數(shù)為 N ?!闭Z句時(shí),將自動(dòng)調(diào)用該類的 析構(gòu)函數(shù) 。 ,將首先完成 類對象成員 的析構(gòu)函數(shù)定義體的執(zhí)行,接著完成 派生類 的析構(gòu)函數(shù)定義體的執(zhí)行,最后完成 基類 的析構(gòu)函數(shù)定義體的執(zhí)行。 賦值語句 實(shí)現(xiàn),也可以通過構(gòu)造函數(shù)中的 初始化表 實(shí)現(xiàn)。 析構(gòu)函數(shù) 。 67.假定要訪問一個(gè)結(jié)構(gòu)指針 p 所指對象中的 b 指針成員所指的對象,則表示方法為 * ( p-> b )。 ?!保瑒t該類型的大小為 24 字節(jié)。 D*d[3]。double c。 64.假定一個(gè)結(jié)構(gòu)類型的定義為 “struct D{ int a。} 。 63.假定一個(gè)結(jié)構(gòu)類型的定義為 “struct B{ int a[8]。} 。short c。 61.假定 a為一個(gè)整型數(shù)組名,則元素 a[4]的字節(jié)地址為 a + 4* sizeof( int ) 或 a + 16 。 59.假定 p是一個(gè)指向 float 型數(shù)據(jù)的指針,則 p+1所指數(shù)據(jù)的地址比 p所指數(shù)據(jù)的地址大 4 字節(jié)。 3 57.假定一個(gè)二維數(shù)組為 a[M] [N],則 a[i] [j]對應(yīng)的存儲(chǔ)地址 (以字節(jié)為單位 )為 a+sizeof(a[0][0])* (i* N + j ) 。 55.假定 a是一個(gè)二維數(shù)組,則 a[i] [j]的指針訪問方式為 *(( a+i ) + j )。 表達(dá)式值為: 50 53.假定 a是一個(gè)指針數(shù)組,則 a+i 所指對象的地址比 a地址大 i* sizeof(uns
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1