#include  
							 閱讀以下說明和C++代碼,將應填入 (n) 處的字句寫在答題紙的對應欄內。成人学院中文字幕,国产午夜麻豆影院在线观看,久久男人免费视频,久久精品美女视频,www.福利视频,蜜桃一本色道久久综合亚洲精品冫,欧美三级视频
   
【說明】 
C++標準模板庫中提供了vector模板類,可作為動態(tài)數(shù)組使用,并可容納任意數(shù)據(jù)類型,其所屬的命名空間為std。vector模板類的部分方法說明如下表所示:
【C++代碼】 
#include <iostream>
#include <vector>
using namespace  (1) ;
typedef vector< (2) > INTVECTOR;
const int ARRAY_SIZE = 6;
void ShowVector(INTVECTOR &theVector);
int main(){
 INTVECTOR theVector;
 // 初始化theVector,將theVector的元素依次設置為0至5
 for (int cEachItem = 0; cEachItem < ARRAY_SIZE; cEachItem++)
theVector.push_back( (3) );
ShowVector(theVector);    // 依次輸出theVector中的元素
theVector.erase(theVector.begin() + 3);  
ShowVector(theVector);
}
void ShowVector(INTVECTOR &theVector) {
 if (theVector.empty())  {
   cout << "theVector is empty." << endl;    return;
 }
   INTVECTOR::iterator (4) ;
   for(theIterator = theVector.begin(); theIterator != theVector.end(); theIterator++){
     cout << *theIterator; 
  if (theIterator != theVector.end()-1)    cout << ", ";
   }
     cout << endl;
}
該程序運行后的輸出結果為:(5)   
							
                    
      
      
                  
                    
					相關試題
