Originally Posted by SlyMaelstrom
A line ends at a newline character '\n'. Therefor you would count the amount of whitespace until you encounter a newline. Store that number for line one, reset the count variable and start counting again for line two. If you wish you could also make a running total of all the whitespace until the pound sign.
And yes, the idea of this exersize would be to ask the user to enter a pound sign. If this is for class, go for bonus points by looking for a pound sign and giving an error message if they didn't put one or append it to the end automatically.
By the way, this is quite simple to do without strings. Just read it in one character at a time. If it's a space or tab, increment the count. If it isn't don't. Then just read over your variable with the next character.