Printing a “triangle” of asterisks, in c++

前端 未结 1 1692
后悔当初
后悔当初 2021-01-07 15:15

i want to make a generic code that prints such output, mean user can enter any value +whole.

    *
   * *
  * * *
 * * * *
* * * * *

for 5

相关标签:
1条回答
  • 2021-01-07 15:38

    place 'space' after * in cout, it adjust all your sequence. mean cout << "* "; thats it.

    0 讨论(0)
提交回复
热议问题