<file_sep>// Fancy hello greetin with variable padding, for loops and using decleration

#include <iostream>
#include <string>

// Define standard libraries we're using
using std::cin;
using std::cout;
using std::endl;
using std::string;

int main(){
	// ask for name
	cout << "Please enter your name: ";
	string name; // initialize name variable
	cin >> name; // read input into name
	cout << endl;

	// ask for row padding
	cout << "How many rows to pad: ";
	int rowpad;
	cin >> rowpad;
	cout << endl;

	// ask for side padding:
	cout << "How much side padding: ";
	int sidepad;
	cin >> sidepad;
	cout << endl;

	// contruct greeting
	const string greeting = "Hello " + name + " :)";

	// Computer numer of columns and rows
	const int rows = rowpad * 2 + 3;
	const string::size_type cols = sidepad * 2 + 2 + greeting.size();
	
	// Loop
	// Write content depending on row r

	for (int r = 0; r != rows; r++) {

		string::size_type c = 0; // current column

		// we have written c character so far in this row
		while (c != cols){

			// are we writing the greeting?
			if (r == rowpad + 1 && c == sidepad + 1){
				cout << greeting;
				c += greeting.size();
			} else {
				// are we writing the border?
				if ( r == 0 || r == rows-1 || c == 0 || c == cols-1){
					cout << "#";
					c++;
				} else {
					cout << " ";
					c++;
				}
			}
		}
		// Written a full line
		cout << endl;
	}

	// Return 0 for succesfull termination
	return 0;
}
<file_sep>// Fance hello greetin with stars

#include <iostream>
#include <string>

int main(){
	// write question
	std::cout << "Please enter your name: ";
	std::string name; // initialize name variable
	std::cin >> name; // read input into name

	// contruct greeting

	const std::string greeting = "Hello " + name + " :)";
	
	// construct box
	const std::string spaces(greeting.size(), ' ');
	const std::string fillrow = "# " + spaces + " #";
	const std::string fullrow(fillrow.size(), '#');

	// write output
	std::cout << std::endl;
	std::cout << fullrow << std::endl;
	std::cout << fillrow << std::endl;
	std::cout << "# " + greeting + " #" << std::endl;
	std::cout << fillrow << std::endl;
	std::cout << fullrow << std::endl;

	return 0;
}
