split_main.cpp
来自「Accelerated c++ 電子書 對 c++ container 多有描述」· C++ 代码 · 共 32 行
CPP
32 行
#include <cctype>
#include <iostream>
#include <string>
#include <vector>
#include "split.h"
using std::cin;
using std::cout;
using std::endl;
using std::getline;
using std::string;
using std::vector;
using std::isspace;
int main()
{
string s;
// read and split each line of input
while (getline(cin, s)) {
vector<string> v = split(s);
// write each word in `v'
for (vector<string>::size_type i = 0; i != v.size(); ++i)
cout << v[i] << endl;
}
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?