Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
#include
#include
using namespace std; int main() { vector
cars = {"Volvo", "BMW", "Ford", "Ford", "Mazda"}; auto it = adjacent_find(cars.begin(), cars.end()); if (it != cars.end()) { cout << *it << " appears twice in a row\n"; } else { cout << "There are no adjacent elements\n"; } return 0; }
Ford appears twice in a row