Read a 3-character string from input into variable inputString. Declare a Boolean variable noSpaces and assign noSpaces with true if inputString does not contain any spaces. Otherwise, assign noSpaces with false.
Ex: If the input is "rtv", then noSpaces is assigned with true, so the output is:
String is valid.
Ex: If the input is "6 ", then noSpaces is assigned with false, so the output is:
String is not valid.
Note: Use getline(cin, inputString) to read the entire line from input into inputString.