#include <iostream>
#include <fstream>
#include <cstdio>
int main(){
std::ifstream inputFile("Random.txt");
if (!inputFile){
printf(There was an error opening the file.\n"); // Displays a message that there has been an error opening the file
return 1;
}
int number;
int count = 0;
double sum = 0;
while (inputFile >> number){
count++;
sum += number; // Reads all the numbers from the file and calculates the number of numbers in the file
}
inputFile.close();
double average = (count != 0) ? (sum / count): 0; // Calculates the sum of all numbers
printf("Number of numbers: %d\n", count);
printf("Sum of numbers: %.2f\n", sum);
printf("Average of all numbers: %.2\n", average);
return 0
}
}