#include <iostream>
#include <cstdlib> // for srand()
#include <ctime>   // for srand(...)
#include <iomanip>
using namespace std;

int main(){
	setlocale(LC_ALL, "rus"); // for the russian language
	int a[20]; // rainfall
	int year = 1; // eyar
	float middle = 0; // middle of rainfall
	srand(time(NULL)); // every time new generation
	for (int i = 0; i < 20; i ++){
		a[i] = rand() % 101; // for 0-100
		middle += a[i];
	}
	middle = middle / 20 * 1.0f; // middle of rainfall
	cout << endl << "количество осаадков в Кинве за 10 лет" << endl << endl;
	cout << "среднее количество осадков за 10 лет" << middle << endl;
	cout << "	январь-июнь" << "	июль-декабрь" << "	среднее" << endl;
	for (int i = 0; i < 20; i += 2){
		cout << setw(2) << year;
		cout << setw(8) << a[i];
		cout << "(" << setw(6) << (middle - a[i]) << ")";
		cout << setw(8) << a[i+1];
		cout << "(" << setw(6) << (middle - a[i+1]) << ")";
		cout << setw(8) << ((a[i] + a[i+1]) / 2) *1.0f;
		cout << endl;
		year++;
	}
	system("pause");
}
