You can't read a variable number of input values in a single scanf statement - if you don't know the number of numbers the user will enter, then you need to:
1) Read the whole line, using fgets
2) Convert it to separate inputs using strtok
3) Process each input using sscanf
While you can say:
scanf("%d %d %d", &a, &b, &c);
There is no mechanism for variable numbers of inputs.