This is the assignment im doing.

Write a program that reads integer data from the standard input unit and prints a list of the numbers followed by the minimum integer read, maximum integer read, and the average of that list. Test your program with the data shown below.
{24 7 31 -5 64 0 57 -23 7 63 31 15 7 -3 2 4 6}

This is c programming btw.
Now i think i know basically what to do, the program needs an input device and then the program loops all the data input until theres nothing left to input. You would use an address like int x; and as you cycle through the numbers if the number your looking at is greater (or less than depending on which function you doing) it gets put in the int x slot, then you print out int x at the end.

My big problem is i dont know an input device that lets you put in any amount of integers. I could use scanf(); and scan a predetermined amount of integers but im not sure if theres some way to tweak scanf or if theres some command i missed when i didnt attend the lecture. Also, im not sure how i would know how to make my program quit looping after its evaluated all the numbers, like i said before if i knew that there where 5 integers being evaluated i could set a counter to decrease by one so that when the counter hits 0 the loop ends. Is there some way i can do this where the counter changes based on the number of integers input?

I hate programming so coming here makes it as painless as possible for me.

Looking through the book this is what ive pieced together so far, im pretty sure it doesnt work, its not close to done anyways.


Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
      int avg;
      int max;
      int min;
      int x;
      int newent;
      printf("\nEnter your integers: <EOF> to stop\n");
      newent = scanf("&#37;d", &x);
      if (newent > max)
         max = newent;
      if (newent < min)
         min = newent;
      printf("Your average is: %d \n Your maximum is: %d \n Your minumum is: %d \n", avg, max, min);
      system("PAUSE");
      return 0;
}
Ill be looking here from time to time most of the night, thanks in advance for any help.