I spent many hours on this and finally solved it tonight... just haven't ran it through the CS50 checker yet.
BLUF:(Bottom line up front:) your heading in wrong direction thinking of multiplication.
You will be building a ("FOR LOOP") with two inner ("FOR LOOPS").
So many people say and advise to use pencil paper and eraser (will be erasing A LOT!) but it is one of those statements people blow off. I did anyways, I drew the picture of what I wanted to get a formula, so I had an idea of where to start but I didn't take the advice as literal as I should.
The outer loop will be for your "rows" or w/e you call them. Not giving the answer there because you will find that much on different pages. I tested my row loop by making it print hello times what my user input height would be. I played with 5 just because its easier to look at. Once it printed my 5 hello's (on different lines) I deleted the print hello part and went to what I really wanted it to do... print spaces (I used dashes until I figured it out so I could count them).
This is where pen and paper comes in handy... so you have a height of say 5... after you draw out what you want your pyramid to look like, count the dashes used to get to the hashes... Now, from there figure out variables that will make the computer draw a dash for you... I did this by saying ok, I started row "0" or "1" w/e you choose, now what "number" is <= "this number"... so think how a computer will (flow charts help) is "x" less than or equal to "y"... no, so print a "-", the "++" at the end means after it prints once, it will add a number to your "x" value... is that new "x" <= "y"... yes do it again, hence a loop.. once the value of "x" is > "y"... no, move to next loop of hashes... and repeat same logic... off to next loop...once "a" is > "b" what do you want to happen... you need a new line, but where should this be placed? You want it inside your original "Row Loop" but not inside the two inner loops.
Computer prints new line... starts "Row Loop" over, goes inside two inner loops and repeats process... NOW!, remember the row constant has just went up 1 number so adjust your two inner variables (X and A) to reflect to help you keep the rotation going... once all data meets its criteria, it will rinse and repeat until your rows = user input.
hope this is just babble... good luck... I fought over 24 hours (separate sittings) at my computer and on paper working on this. You will feel very accomplished once you have it, definitely if you are like me with ZERO programming background.