#include <iostream>
#include <string>
//#include <windows.h>
using namespace std;
string Center(string str) {
int espacos = (int)((21 - str.length())/2);
return string(espacos, ' ') + str + string(espacos + (str.length() > espacos * 2 ? 1 : 0), ' ');
}
int main() {
string mensagem;
// HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
cout << "Digite um palavara: ";
cin >> mensagem;
// SetConsoleTextAttribute( handle, 12 );
cout << "***************************" "\n";
cout << "***************************" "\n";
cout << "*** ***" "\n";
cout << "*** ***" "\n";
cout<< "***" << Center(mensagem) << "***""\n";
cout << "*** ***" "\n";
cout << "*** ***" "\n";
cout << "***************************" "\n";
cout << "***************************" "\n";
// SetConsoleTextAttribute( handle, 0 );
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgovLyNpbmNsdWRlIDx3aW5kb3dzLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpzdHJpbmcgQ2VudGVyKHN0cmluZyBzdHIpIHsKICAgaW50IGVzcGFjb3MgPSAoaW50KSgoMjEgLSBzdHIubGVuZ3RoKCkpLzIpOwogICByZXR1cm4gc3RyaW5nKGVzcGFjb3MsICcgJykgKyBzdHIgKyBzdHJpbmcoZXNwYWNvcyArIChzdHIubGVuZ3RoKCkgPiBlc3BhY29zICogMiA/IDEgOiAwKSwgJyAnKTsKfQoKaW50IG1haW4oKSB7CglzdHJpbmcgbWVuc2FnZW07Ci8vCUhBTkRMRSBoYW5kbGUgPSBHZXRTdGRIYW5kbGUoU1REX09VVFBVVF9IQU5ETEUpOwogICAgY291dCA8PCAiRGlnaXRlIHVtIHBhbGF2YXJhOiAiOwogICAgY2luID4+IG1lbnNhZ2VtOwovLyAgICBTZXRDb25zb2xlVGV4dEF0dHJpYnV0ZSggaGFuZGxlLCAxMiApOwogICAgY291dCA8PCAiKioqKioqKioqKioqKioqKioqKioqKioqKioqIiAiXG4iOwogICAgY291dCA8PCAiKioqKioqKioqKioqKioqKioqKioqKioqKioqIiAiXG4iOwogICAgY291dCA8PCAiKioqICAgICAgICAgICAgICAgICAgICAgKioqIiAiXG4iOwogICAgY291dCA8PCAiKioqICAgICAgICAgICAgICAgICAgICAgKioqIiAiXG4iOwogICAgY291dDw8ICIqKioiIDw8IENlbnRlcihtZW5zYWdlbSkgPDwgIioqKiIiXG4iOwogICAgY291dCA8PCAiKioqICAgICAgICAgICAgICAgICAgICAgKioqIiAiXG4iOwogICAgY291dCA8PCAiKioqICAgICAgICAgICAgICAgICAgICAgKioqIiAiXG4iOwogICAgY291dCA8PCAiKioqKioqKioqKioqKioqKioqKioqKioqKioqIiAiXG4iOwogICAgY291dCA8PCAiKioqKioqKioqKioqKioqKioqKioqKioqKioqIiAiXG4iOwovLyAgICBTZXRDb25zb2xlVGV4dEF0dHJpYnV0ZSggaGFuZGxlLCAwICk7CglyZXR1cm4gMDsKfQ==