- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.cpp
More file actions
Latest commit
29 lines (26 loc) · 505 Bytes
/
Copy pathtemplate.cpp
File metadata and controls
29 lines (26 loc) · 505 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<bits/stdc++.h>
usingnamespacestd;
vector<string> split(string input, string delimiter)
{
vector<string> ret;
longlong pos = 0;
string token = "";
while ((pos = input.find(delimiter)) != string::npos)
{
token = input.substr(0, pos);
ret.push_back(token);
input.erase(0, pos + delimiter.length());
}
ret.push_back(input);
return ret;
}
intmain(void)
{
string s;
cin >> s;
vector<string> vc = split(s, "1");
for (auto a : vc)
cout << a << "";
cout << "\n";
return0;
}