View difference between Paste ID: HZcnVj5y and w2KggHYF
SHOW: | | - or go back to the newest paste.
1
#include <iostream>
2
#include <algorithm>
3
 
4
using namespace std;
5
6
void PrintSpacesPositions(string& str) {
7
    // напишите реализацию
8
    auto start = find(begin(str), end(str), ' ');;
9
    while(start!=end(str)){
10
        cout << distance(begin(str), start) << endl;
11
        start = find(next(start),end(str), ' ');
12
    }
13
}
14
int main() {
15
    string str = "He said: one and one and one is three"s;
16
    PrintSpacesPositions(str);
17
    return 0;
18
}