Good afternoon all! I'm requesting an integer and using the same integer to print a pyramid pattern using nested loops. However i'm also trying to omit the requested integer's non-factors from appearing in the patterns. So for example I request the integer 6, rows 4 and 5 would not appear in the pattern. Problem is, I don't know how to do it!
Nice! Your solution merges several methods from the primer. I also wanted to eliminate the inner loop, alas str.append(i, '*') refuses to work with "* ". C++ is not REXX :(
This is the first time I've seen that. It appears that operator*(int N,const std::string &S) returns a string with N copies of S. Is that right? I can't find this in any reference, can you point me to one?
Wrong (IMO). Pls read carefully the 2nd sentence of OP again: "I'm requesting an integer and using the same integer to print a pyramid pattern using nested loops."
I translate "I'm requesting an integer" by 'my program prompts for an integer'. Similar "using nested loops" looks for me like a description but not a mandatory way to do it.
Nothing about order/assignment/requested to... or similar. (As said before, IMO, because I am not a native speaker.)
Second:
Did you run your code?
Please enter a positive integer: 6
*
**
***
Seems you omit the last row with howmany = user input stars. In that case you may also omit the first one with howmany = 1 -- it is constantly the same for all runs. But foremost you do omit the blanks between the stars intentionally?