It takes a minute to figure it out but it is relatively straight-forward.
You'll have to write the getsym() function to gather symbols from the input stream.
If this is homework, it is poorly-designed. The above would better fall under the category of lexing, whereas recursive descent is parsing, or analysis of lexed tokens.
Alas, I know this doesn't help too much. Can you be more specific in terms of what you are doing?
The following post may help:
http://www.cplusplus.com/forum/general/1116/page2.html
(the post that starts "Here is some code put together from Stroustrups book")
It doesn't affect speed significantly. But it makes the whole process much easier to control.
To fix the routine, the getsym() compares to getchar() (since each 'symbol' in a number is a single character) and use functions like in the Wikipedia article to work your way through the number to either validate it or reject it.