下载此文档

CSTL范例大全教程.docx


文档分类:IT计算机 | 页数:约16页 举报非法文档有奖
1/16
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/16 下载此文档
文档列表 文档介绍
Sample of STL
STL范例 ( 一)
容器部分
Vector-------------------------------------------1
r<int>(cout," "));
cout << endl;
(4);
copy(),(),
ostream_iterator<int>(cout," "));
cout << endl;
return 0;
}
OUTPUT:
rint();
return 0;
}
OUTPUT:
irst << " "
*(3).second << endl; cout << endl;
cout << "lower_bound(5): "
*(5) << endl;
cout << "upper_bound(5): "
*(5) << endl;
cout << "equal_range(5): "
*(5).first << " "
*(5).second << endl;
();
}
OUTPUT:
rint();
}
return 0;
}
OUTPUT:
rI++
Taras Taras
rint();
}
return 0;
}
OUTPUT:
irst << " - "
(*It).second
endl;
It++;
}
irst << " - "
(*It).second
endl;
It++;
}
M m3(),());
It = ();
cout << endl << "m3:" << endl;
while ( It != () )
{
cout << (*It).first << " - "
(*It).second
endl;
It++;
}
return 0;
}
OUTPUT:
irst << " - "
(*It).second
endl;
It++;
}
return 0;
}
OUTPUT:
irst << ": ";
for ( Li = It->();
Li != It->(); Li++ )
cout << *Li << " ";
cout << endl;
}
int n = (2);
cout << "count of element with key '2' (0 or 1) is "
n << endl; return 0;
}
OUTPUT:
econd << " ";
It++;
}
cout << endl;
cout << "size of map = " << ()
<< endl;
cout << "map 'm' is " << () ?
"" : "not ") << "empty" << endl << endl;
(),());
cout << "After (),())"
<< endl;
cout << "size of map = " << ()
<< endl;
cout << "map 'm' is " << () ?
: "not ") << "empty" << endl; return 0;
}
OUTPUT:
irst << " - ";
cout << (*It).second << end

CSTL范例大全教程 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数16
  • 收藏数0 收藏
  • 顶次数0
  • 上传人飞行的优优
  • 文件大小50 KB
  • 时间2022-04-17