Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- void PrintSpacesPositions(string& str) {
- // напишите реализацию
- auto start = find(begin(str), end(str), ' ');;
- while(start!=end(str)){
- cout << distance(begin(str), start) << endl;
- start = find(next(start),end(str), ' ');
- }
- }
- int main() {
- string str = "He said: one and one and one is three"s;
- PrintSpacesPositions(str);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment