#include <iostream>
int main()
{
int sum(0), pr(1), ot(0), pol(0);
const int n = 5; //колво чисел
int arr[n];
for (int m = 0; m < n; m++)
std::cin >> arr[m];
}
for (int i = 0;i < n; i++)
sum += arr[i];
pr *= arr[i];
if (arr[i] > 0) {pol++;}
else {ot++;}
std::cout << sum << " " << pr << " " << pol << " " << ot;
return 0;
Объяснение:
#include <iostream>
int main()
{
int sum(0), pr(1), ot(0), pol(0);
const int n = 5; //колво чисел
int arr[n];
for (int m = 0; m < n; m++)
{
std::cin >> arr[m];
}
for (int i = 0;i < n; i++)
{
sum += arr[i];
pr *= arr[i];
if (arr[i] > 0) {pol++;}
else {ot++;}
}
std::cout << sum << " " << pr << " " << pol << " " << ot;
return 0;
}
Объяснение: