Our task for school lesson is to input a number of integers. We don't know how many there will be.

I would like to know if there is a possibility to format `scanf` function that either stores integer or terminate itself by pressing enter.

Can I somehow put together `scanf("%d")` which only stores integers and `scanf("%[^\n])` which terminates `scanf` function?

What I have known yet is that I cannot use `scanf("%d%[^\n])` because `scanf` is waiting for that one integer, which I don't want to input because I already stored all integers I had to.

I don't really like a possibility to store string of all those integers into an array and then convert it to elements of another array with the exact numbers.