#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    std::vector<char> word{'a', 'b', 'a', 'c', 'a'};
    char letter = 'a';

    auto idx = std::find(word.begin(), word.end(), letter);
    while (idx != word.end()){
        auto pos = std::distance(word.begin(), idx);
        std::cout<<"Find "<<word[pos]<<" at: "<<pos<<std::endl;
        idx = std::find(++idx, word.end(), letter);
    }
    return 0;
}