- Each line will have same number of characters, lets say N.
- for each line the loop would go from 1 - N
- print count would start from N-1 for boxes and 1 for a *
- for each line, the count of boxes will keep on decreasing and the same would be added to the print count of *. Eg. line 1 - 5 boxes, 1 star; line 2 - 4 boxes, 2 stars etc..
Declare a few more variables so you can see exactly what you need, then focus on making it leaner and more clever later. Notice how the variable names make it easy to spot where you must figure out the logic for your problem.
Make sure you didn't accidentally forget to close your executable since the last time you ran it (i.e. make sure none of your console windows from your previous runs are still open).
writeonsharma's solution is about the best you're going to get. We're not here to solve your assignments we're here to assist with concepts that you don't get.