If you are going to enter all the numbers on one line, then there is absolutely no need to start by entering the number of numbers that will follow.
You will need to read the entire line in the line, ( char[] ), and then parse that line to find substrings separated by spaces, and then you need to parse each substring into a number.
Exactly how to do this, we will not talk, because stackoverflow is not what others do your homework for you.
Mike nakis
source share