En la pastelería caben como mucho 12 caracteres en una tarta (los espacios también cuentan). Escribe fits_on_cake(msg): true si cabe y false si no. Un mensaje vacío cabe.
fits_on_cake("Happy Birthday")→Falsefits_on_cake("Hi Mom")→Truebool fits_on_cake(const string &msg)#include <string>
using namespace std;
bool fits_on_cake(const string &msg) {
int length = 0;
// tu código aquí: haz que length sea cuántos caracteres tiene msg
return length <= 12;
}
Ejecutar prueba los ejemplos. Cuando salgan bien, Enviar.