This:
const int chCnt = 6;
for (int ch = 1; ch <= chCnt; ch++)
qDebug
() <<
QString(" ").
repeated(chCnt
- ch
) + QString("*").
repeated(ch
);
const int chCnt = 6;
for (int ch = 1; ch <= chCnt; ch++)
qDebug() << QString(" ").repeated(chCnt - ch) + QString("*").repeated(ch);
To copy to clipboard, switch view to plain text mode
gives:
" *"
" **"
" ***"
" ****"
" *****"
"******"
" *"
" **"
" ***"
" ****"
" *****"
"******"
To copy to clipboard, switch view to plain text mode
But your post is under General Programming so maybe this solution is not good for you, but I decided to post it any way
Bookmarks