#include <iostream>
#include <fstream>
using namespace std;
 
int main ()
{
        ifstream file_in;
        file_in.open("input.txt");
 
        if (!file_in)
        {
               cout << "File not found!" << endl;
               exit(1);
        }
 
        int numb = 0, count = 0, total = 0;
        double avg;
 
        while (file_in >> numb)
        {
 
               while (file_in.get() != '\n')
               {
                       total = total + numb;
                       count++;
                       file_in >> numb;
               }
 
               total = total + numb;
               count++;
 
               avg = double(total)/double(count);
               cout << avg << endl;
               
               count = 0;
               total = 0;
        }
        return 0;
}

syntax highlighted by Code2HTML, v. 0.9.1