better print

This commit is contained in:
Francesco Gatti
2017-08-09 16:04:49 +00:00
parent 1c6888f312
commit b75fa637cb
6 changed files with 33 additions and 20 deletions
+3 -1
View File
@@ -5,7 +5,9 @@ void printCenteredTitle(const char *title, char fill, int dim) {
int len = strlen(title);
int first = dim/2 + len/2;
if(len >0)
std::cout<<"\n";
std::cout.width(first); std::cout.fill(fill); std::cout<<std::right<<title;
std::cout.width(dim - first); std::cout<<"\n";
std::cout.fill(' ');