题目
C++中split怎么定义啊?
#include
#include
#include
#include
#include "split.h"
using std::cin; using std::cout;
using std::endl; using std::getline;
using std::istream; using std::string;
using std::vector; using std::map;
map
xref(istream& in,
vector find_words(const string&) = split)
{
string line;
int line_number = 0;
map ret;
while (getline(in,line)) {
++line_number;
vector words = find_words(line);
#ifdef _MSC_VER
for (std::vector::const_iterator it = words.begin();
#else
for (vector::const_iterator it = words.begin();
#endif
it = words.end(); ++it)
ret[*it].push_back(line_number);
}
return ret;
}
int main()
{
map ret = xref(cin);
#ifdef _MSC_VER
for (std::map::const_iterator it = ret.begin();
#else
for (map::const_iterator it = ret.begin();
#endif
it = ret.end(); ++it) {
cout first second.begin();
#else
vector::const_itera
#include
#include
#include
#include
#include "split.h"
using std::cin; using std::cout;
using std::endl; using std::getline;
using std::istream; using std::string;
using std::vector; using std::map;
map
xref(istream& in,
vector find_words(const string&) = split)
{
string line;
int line_number = 0;
map ret;
while (getline(in,line)) {
++line_number;
vector words = find_words(line);
#ifdef _MSC_VER
for (std::vector::const_iterator it = words.begin();
#else
for (vector::const_iterator it = words.begin();
#endif
it = words.end(); ++it)
ret[*it].push_back(line_number);
}
return ret;
}
int main()
{
map ret = xref(cin);
#ifdef _MSC_VER
for (std::map::const_iterator it = ret.begin();
#else
for (map::const_iterator it = ret.begin();
#endif
it = ret.end(); ++it) {
cout first second.begin();
#else
vector::const_itera
提问时间:2020-11-14
答案
split好像是list容器所特有的啊.
你想干什么呢?
哦,算了我没看清楚题.
你有spih.h这个文件吗?
你想干什么呢?
哦,算了我没看清楚题.
你有spih.h这个文件吗?
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
- 1Mr.Black goes to Shanghai (twice) a year.对twice提问
- 2已知|ab-2|与|b-1|互为相反数,试求下列代数式的值
- 3--Do you often watch NBA_____TV --Yes,i do.
- 4梯形上、下底之比为2:3,则中位线被一条对角线分成的两条线段之比为( ).A.2:3 B.1:3 C.3:4 D.4:9
- 5Use personal pronouns to rewrite the sentences是什么意思
- 6已知x,y在(0,π/2),求函数F(x)=√(sinX+tanX)+√(cosX+cotX)的最小值.
- 7一立方米的氢气能产生多大的浮力?
- 8三峡工程巨大的环境效益主要指?(简洁,要简洁有多简洁)
- 9She made the house _______(clean)
- 10when the sun smiles,the birds smile back,good morning,
热门考点