#include <iostream>
#include <math.h>
using namespace std;
void main()
{
int a[20], n, i, kol = 0, s = 0;
cout << "\t Input N (<=20) ";
cin >> n;
cout << "\n\t Massiv A" << endl;
for (i = 0; i < n; i++) {
cout << "\t a[ " << i + 1 << " ] = ";
cin >> a[i];
}
for (i = 0; i < n; i++)
if (a[i] % 2 == 0) {
kol++;
s += pow(a[i],2);
}
cout << "\n Kol = vo = " << kol << "\t Summa = " << s << endl;
cout << "\n Press any key ... " << endl;
cin.get();
}
#include <iostream>
int main() {
int arr[]{2,1,2,2,0,7,1,3,7,5,7,0,1,2};
int len = std::size(arr);
int max = arr[0], count{0}, ind{0}, sum{0};
for(int i{0}; i < len; ++i) {
if(max < arr[i]) max = arr[i];
if(i == len-1) {
for(int j{0}; j < len; ++j) {
if(arr[j] == max) { ++count; ind = j; }
}
while(++ind < len) { sum += (arr[ind] * arr[ind]); }
}
}
std::cout << '\n' << max << ' ' << count << ' ' << sum;
return 0;
}