#include<iostream>
#include<fstream>
using namespace std;

int main()
{
	fstream dataFile;
	int num;
	double sum;
	double avg;
	int i=0;
	
	cout<<" Opening the file...\n";
	dataFile.open("Random.txt", ios::in);
	
	if(dataFile)
	{
		while(dataFile>>num)
		{
			i++;
			sum+=num;
		}
	}
	
	else
	{
		cout<<"ERROR: Cannot open file\n";
		return 0;
	}
	dataFile.close();
	
	cout<<"The number of the number in the file is: "<<i<<endl;
	cout<<"The sum of all the numbers in the file is: "<<sum<<endl;
	
	avg=sum/i;
	cout<<"The average of all the numvers in the file is: "<<avg<<endl;
	
	return 0;
}
