1)В массиве А(7) найти количество элементов больших числа 6
2)В массиве Р(12) вычислить произведение всех четных элементов
3) В массиве Т(17) вычислить сумму всех элементов, индексы которых больше числа N

Ответы

Ответ дал: stglupa
0

#include <iostream>

#include <vector>

using namespace std;

void solve1(){

   const int N = 7, X = 6;

   int cnt = 0;

   vector<int> a(N);

   for(auto &i: a) cin >> i;

   for(auto &i: a) cnt += (i > X);

   cout << cnt;

}

void solve2(){

   const int N = 12;

   int res = 1;

   vector<int> p(N);

   for(auto &i: p) cin >> i;

   for(auto &i: p)

       if(!(i & 1))

           res *= i;

   (res == 1) ? cout << 0 : cout << res;

}

void solve3(){

   const int N = 17;

   int x, ans = 0;

   vector<int> t(N);

   for(auto &i: t) cin >> i;

   cin >> x;

   while(++x < N)

       ans += t[x];

   cout << ans;

}

int main(){

   //solve1();  //task1

   //solve2();  //task2

   //solve3(); //task3

}

Вас заинтересует