呵呵
string Msg(int length, char *cstr)
{
string str(length, '*');
int size = int(str.length() / 3);
str.replace(size, 1, 1, '\n');
str.replace(size*2, 1, 1, '\n');
string str1(cstr);
str.replace(size + 1, size -1, size -1, ' ');
int repalce_begin =int( (str.length() - str1.length())/2);
str.replace(repalce_begin, str1.length(), str1.c_str(), 0, str1.length() ); // 晕一直在替换!!!!!!!
return str;
}
string str = Msg(300, "Very Good");
cout << str.c_str() << endl;