Strings

5.6 - String fill constructor


std::string has a fill constructor following the form std::string(size_t n, char c). This constructs a string with the character c of the length n.

// stars = "*****"
std::string stars(5, '*');

Task

Your task is to create a program which takes a name input and frames it in asterisks (*).

Sample input

tom

Sample output

*******
*     *
* tom *
*     *
*******
#include <string> #include <iostream> int main() { }