number reverse

i had a problem on codechef that said that i have to make a program that enables the user (in this case the online judge) to input some numbers ( they can be 2 numbers or 7 different numbers) but less than 10.

the question is: how can we limit the upper point for the no of inputs? and how can we make a program when we don’t even know how many inputs the user is going to give?

i’m a C++ coder.

Input a string or the complete line in a character array. Then using stringstream you can can store the numbers in another array.

1 Like