4.10

#define  _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<array>
using namespace std;

int main()
{
	double sum = 0;
	array<double, 3>average_for_40meter;
	for (int i = 0; i < 3; i++)
	{
		cout << "Please enter the scores of " << i + 1 << "th: ";
		cin >> average_for_40meter[i];
		sum += average_for_40meter[i];
	}
	double average = sum / 3;
	cout << "The average score of 40 meters is: " << average << endl;
	return 0;
}

你可能感兴趣的:(C++)