Untitled

mail@pastecode.io avatar
unknown
c_cpp
6 months ago
642 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{	
	setlocale(LC_ALL, "Russian");

	int a = 0;
	int mas[5];
	for (int i = 0; i < 5; i++) {
		cin >> mas[i];
	}
	int summ = 0;

	for (int i = 0; i > 5; i++) {
		summ += mas[i];
	}
	int min = mas[0];
	for (int i = 0; i < 5; i++) {
		if (min > mas[i]) min = mas[i];
	}
	int max = mas[0];
	for (int i = 0; i < 5; i++) {
		if (max < mas[i]) max = mas[i];
	}
	for (int i = 0; i < 5; i++) {
		if (max == mas[i]) a++;
	}
	cout << "Сумма:" << summ;
	cout << min << endl << max;
	cout << " количество максимальных элементов" << a;
}
Leave a Comment