The only way I know is to have them enter the numbers. If they don't enter enough, reprint the input (optional) and prompt for the rest. If they enter too many, use only what is required.
Some operating system consoles will allow characters to be read as they are typed. Unix is one of them. But that opens up a whole new can of worms. You have to keep taking in digits until the user types a delimiter. But then, what about a number like the 10e3 which is 1000. So you need to correctly parse the input. If this is for an assignment I would discuss with the instructor to see what is acceptable/required.
Regards,
Jim