自建网站需要哪些技术网站空间容量
news/
2025/10/6 18:05:34/
文章来源:
自建网站需要哪些技术,网站空间容量,网站内容建设项目预算,托福培训一对一C Primer#xff08;第5版#xff09; 练习 10.24
练习 10.24 给定一个string#xff0c;使用bind和check_size在一个int的vector中查找第一个大于string长度的值。。
环境#xff1a;Linux Ubuntu#xff08;云服务器#xff09;
工具#xff1a;vim 代码块
/*****…C Primer第5版 练习 10.24
练习 10.24 给定一个string使用bind和check_size在一个int的vector中查找第一个大于string长度的值。。
环境Linux Ubuntu云服务器
工具vim 代码块
/************************************************************************* File Name: ex10.24.cpp Author: Mail: Created Time: Sun 03 Mar 2024 08:43:07 PM CST************************************************************************/#includeiostream
#includestring
#includevector
#includealgorithm
#includefunctional
using namespace std;
using namespace placeholders;bool check_size(const int n, string::size_type sz){return n sz;
}int main(){string str;coutEnter string: ;cinstr;string::size_type sz str.size();vectorint number;int num;coutEnter numbers: ;while(cinnum){number.push_back(num);if(cin.get() \n){break;}}auto wc find_if(number.begin(), number.end(), bind(check_size, _1, sz));cout*wcendl;return 0;
}运行结果显示如下
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/929579.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!