华中科技大学C++课件异常处理.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
华中科技大学C课件异常处理

cout After inserts, there are intMultiset.count( 15 ) values of 15 in the multiset\n; ims::const_iterator result; result = intMultiset.find( 15 ); // find returns iterator if ( result != intMultiset.end() ) // if iterator not at end cout Found value 15\n; // found search value 15 result = intMultiset.find( 20 ); if ( result == intMultiset.end() ) // will be true hence cout Did not find value 20\n; // did not find 20 multiset的例子 intMultiset.insert( a, a + SIZE ); // add array a to multiset cout After insert intMultiset contains:\n; copy( intMultiset.begin(), intMultiset.end(), output ); cout \nLower bound of 22: *( intMultiset.lower_bound( 22 ) ); cout \nUpper bound of 22: *( intMultiset.upper_bound( 22 ) ); pair ims::const_iterator, ims::const_iterator p; p = intMultiset.equal_range( 22 ); cout \nUsing equal_range of 22 \n Lower bound: *( p.first ) \n Upper bound: *( p.second ); cout endl; return 0; } multiset的例子 // Fig. 20.20: fig20_20.cpp // Testing Standard Library class set #include iostream #include set #include algorithm using namespace std; int main() { typedef set double, less double double_set; const int SIZE = 5; double a[ SIZE ] = { 2.1, 4.2, 9.5, 2.1, 3.7 }; double_set doubleSet( a, a + SIZE );; ostream_iterator double output( cout, ); cout doubleSet contains: ; copy( doubleSet.begin(), doubleSet.end(), output ); set的例子 pair double_set::const_iterator, bool p; p = doubleSet.insert( 13.8 ); // value not in set cout \n *( p.first ) ( p.second ? was : was not ) inserted; cout \ndoubleSet contains: ; copy( doubleSet.begin(), doubleSet.end(), output ); p = doubleSet.insert( 9.5 ); // value already in set cout \n *( p.first ) ( p.second ? was : was not ) inserted; cout \ndoubleSet contains: ; copy( doubleSet.b

文档评论(0)

wyjy + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档