9.5.3
来源:互联网 发布:cloudify 教程 ubuntu 编辑:程序博客网 时间:2024/05/22 05:13
@pezy
9.47
#include <string>#include <iostream>using std::string;using std::cout;using std::endl;int main(){ string numbers{ "123456789" }; string alphabet{ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" }; string str{ "ab2c3d7R4E6" }; cout << "numeric characters: "; for (int pos = 0; (pos = str.find_first_of(numbers, pos)) != string::npos; ++pos) cout << str[pos] << " "; cout << "\nalphabetic characters: "; for (int pos = 0; (pos = str.find_first_of(alphabet, pos)) != string::npos; ++pos) cout << str[pos] << " "; cout << endl; return 0;}
9.48
string::npos
9.49
#include <string>#include <fstream>#include <iostream>using std::string; using std::cout; using std::endl; using std::ifstream;int main(){ ifstream ifs("../data/letter.txt"); if (!ifs) return -1; string longest; auto update_with = [&longest](string const& curr) { if (string::npos == curr.find_first_not_of("aceimnorsuvwxz")) longest = longest.size() < curr.size() ? curr : longest; }; for (string curr; ifs >> curr; update_with(curr)); cout << longest << endl; return 0;}
0 0
- 9.5.3
- 9.5.3 Declaration directives
- PGP Desktop 9.5.3
- 9.5.3 Cursor对象
- PostgreSQL 9.5.3 中文手册
- eaccelerator0.9.5.3模块安装
- PostgreSQL 9.5.3 中文手册
- 9.5
- C++primer(第五版)9.5.1节,9.5.2节,9.5.3节,9.5.5节,9.6节练习答案
- 9.5.3远程服务协议-Mina协议
- ultraiso 9.5.3安装红旗linux5.0
- 第九章 9.5.3节练习
- 9.5(3)求和:输入的20个数
- 编译安装PostgreSQL-9.5.3数据库
- centos7.3下安装git2.9.5
- C++Primer第五版 9.5.3节练习
- 9.5 permuation
- 黄迪明9.5
- 最新2016年传智播客前端开发视频教程1期
- So hard so brave --y\
- jsp错误 According to TLD, tag form:input must be empty, but is not
- 常用的meta标签
- HDU 5882 Balanced Game
- 9.5.3
- Binary Tree Level Order Traversal
- sentry客户端raven黑魔法一例
- 逆向汇编的基本知识梳理
- 数学建模模拟退火法MATLAB程序参考模板
- 我为什么不看好微信小程序
- UVa1585 得分 算法竞赛入门经典第二版CH-2习题3-1
- 9.5.5
- PAT乙级(Basic Level)真题1004