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

正文內(nèi)容

模板與標(biāo)準(zhǔn)模板庫(kù)ppt課件-資料下載頁(yè)

2025-05-01 02:36本頁(yè)面
  

【正文】 )。 cout“s sorted in ascending order:” sendl。 return 0。 } STL算法 排序和搜索、數(shù)值處理、集合運(yùn)算、復(fù)制等 include cstdlib include iostream include vector include algorithm using namespace std。 void dump(int i) { coutiendl。 } bool odd(int i) { return i % 2 != 0。} bool p(const intamp。 i1, const intamp。 i2) { return i1i2。 } int main() { vector int v(10)。 generate((), (), rand)。 replace_if((), (), odd, 0)。 sort((), (), p)。 for_each((), (), dump)。 return 0。 } include iostream include algorithm using namespace std。 void print(const char*, char [], int)。 int main() { const int LEN = 27。 const int MED = LEN / 2。 char alph[] = “abcdefghijklmnopqrstuvwxyz{”。 print(“\n\nOriginal array:\n”, alph, LEN )。 random_shuffle(alph, alph + LEN)。 print(“\After random_shuffle:\n”, alph, LEN )。 nth_element(alph, alph + MED, alph + LEN)。 print(“\n\nAfter nth_element:\n”, alph, LEN )。 print(“\n\t median: ”, alph, MED )。 print(“\n\t median: ”, alph+MED ,1)。 print(“\n\t median: ”, alph+MED+1 ,LEN / 2)。 coutendl。 return 0。 } void print(const char* msg, char a[], int len) { coutmsg。 copy(a, a+len, ostream_iteratorchar(cout, “ ”)。 } 其他 STL構(gòu)件 函數(shù)對(duì)象 (function object) 函數(shù)適配器 (function adaptor) STL allocator 異常處理 void g() { try { f()。 //…… } catch (int x) { //整型異常被拋出的處理 } catch (char s) { //字符型的異常被拋出的處理 } } 例 string s。 int index, len。 while (true) { cout “Enter index and length to erase: “。 cin index len。 try { ( index, len)。 } catch (out_of_range) { cout “Out of range!” endl。 continue。 } break。 } 例 const int MaxSize = 1000。 float arr[ MaxSize ]。 enum out_of_bounds { underflow , overflow}。 float amp。 access ( int i) { if (i 0) throw underflow。 if (i = MaxSize) throw overflow。 return arr[ i ]。 } void g() { //…… try { val = access (k)。 } catch ( out of_bounds t) { if (t == underflow) { cerr“arr:underflow…aborting \n”。 exit( EXIT_FAILURE)。 } if (t== overflow) { cerr“arr:overflow…aborting \n”。 exit( EXIT_FAILURE)。 } } //……
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1