Kodewick
Start learning →
Starter←→0 / 86

Reading the Dice

#084Startercase 3: … break;3 min

Say the number the dice shows: 1 is one, 2 is two, 3 is three, anything else is many. The first two and the last one are written — add the one for 3. This roll is a 3.

Should show
three
main.cpp
#include <iostream>
using namespace std;

int main() {
    int n = 3;
    switch (n) {
        case 1:
            cout << "one" << endl;
            break;
        case 2:
            cout << "two" << endl;
            break;
        // your code here: show three when n is 3
        default:
            cout << "many" << endl;
    }
    return 0;
}
Ctrl + Enter runs too
Result

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