No, I'd say it's wrong.
The question asks you to "input 5 numbers" and "ignore any that have been entered before".
What if I enter 1, 2, 2? You should be ignoring them as they are entered, and checking against the "current list" of values.
To do that, create an array of 5 integers, and an index which starts at zero.
Now use a loop which continues until you index equals 5 - the number of integers you are required to collect.
Inside the loop, get the user to input a number.
Use a
for
loop to check it against the ones he entered before (they are in the array, with values less than the index you created). If the value is there already, ignore it.
Otherwise, insert it to the array, and increment the index.
Try it manually, and you'll see what I mean - it's the same process you would use to do it on paper.
If you can't get started, have a look at this:
How to Write Code to Solve a Problem, A Beginner's Guide[
^] - it should give you a technique for working things out a bit better.