28. C++的物件導向程式設計中,STL(standard template library)的應用扮演著重要的角色。以下的C++程式碼運用STL中vector類別樣版(class template)及相關的標準函式庫。試問執行後的輸出為何? 
vector<char> vch;
char tool[]="TEMPLATES";
for(int i=0; i<9; i++)
  vch.push_back(tool[i]);
vch.erase(vch.begin()+3);
vch.insert(vch.end()-2,'C');
for(int j=0;j<9;j++)
  cout<<vch[j];

(A) TEMPLATES 
(B) TEPLATECS 
(C) TEPLATES 
(D) TEMLATCES

答案:登入後查看
統計: A(5), B(13), C(8), D(7), E(0) #654042

詳解 (共 2 筆)

#4584729
TEMPLATES 0 1  2  3...
(共 99 字,隱藏中)
前往觀看
2
0
#956466
??
0
0