Kodewick
Start learning →
Starter←→0 / 3

Shout it

#002StarterStrings3 min

Write shout(s): make every letter in s a capital and add ! at the end. Anything that is not a letter stays.

Examples
shout("hi")→'HI!'
shout("")→'!'
The functionstring shout(string s)
main.cpp
#include <string>
#include <cctype>
using namespace std;

string shout(string s) {
    for (char &ch : s) {
        // your code here: make ch a capital
    }
    return s + "!";
}
Ctrl + Enter runs too
Result

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