Kodewick
Start learning →
Starter←→0 / 60

Dinner time

#010StarterLoopsOutput2 min

It's dinner time at the pet shop, and every pet gets called by name. The range-for is ready; inside it, show a line like Dinner time, Mimi!, one line per pet.

Should show
Dinner time, Mimi!
Dinner time, Bao!
Dinner time, Coco!
main.cpp
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
    vector<string> pets = {"Mimi", "Bao", "Coco"};
    for (const string &pet : pets) {
        // your code here: show Dinner time, the name and an exclamation mark
    }
    return 0;
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.