#include <iostream>
#include <cmath>
#include <algorithm>
#pragma GCC optimize("Ofast")
#define ll long long
#define ld long double
using namespace std;
bool check_last(ll num){
if(num % 10 == 2)
return true;
else
return false;
}
bool check_parity(ll num){
while(num > 0){
if(num % 10 % 2 == 1)
num /= 10;
ld func(ll num){
ll sum = 0,am = 0;
sum += num % 10;
am++;
return sum/am;
signed main() {
ll n;
cin >> n;
ll a[n];
for(ll i = 0; i < n; i++)
cin >> a[i];
for(auto i: a){
if(check_last(i) && check_parity(i))
cout << "Среднее арифметическое числа " << i << " равно: " << func(i) << "\n";
ld sum = 0, sumkv = 0, sum6 = 0;
ll prod = 1;
for(ll i = 0; i < n; i++){
sum += a[i];
prod *= a[i];
if(i < 6)
sum6 += a[i];
sumkv += pow(a[i],2);
ll sum_k = 0;
ll k1,k2;
cin >> k1 >> k2;
for(ll i = k1-1; i < k2; i++)
sum_k+=a[i];
ld av = sum/n;
ld av_s;
ld sum_s = 0;
ll s1,s2;
cin >> s1 >> s2;
for(ll i = s1-1;i < s2; i++)
sum_s += a[i];
av_s = sum_s/(s2-s1 + 1);
cout << "a) " << sum << "\n";
cout << "б) " << prod << "\n";
cout << "в) " << sumkv << "\n";
cout << "г) " << sum6 << "\n";
cout << "д) " << sum_k << "\n";
cout << "е) " << av << "\n";
cout << "ж) " << av_s << "\n";
#include <iostream>
#include <cmath>
#include <algorithm>
#pragma GCC optimize("Ofast")
#define ll long long
#define ld long double
using namespace std;
bool check_last(ll num){
if(num % 10 == 2)
return true;
else
return false;
}
bool check_parity(ll num){
while(num > 0){
if(num % 10 % 2 == 1)
return false;
num /= 10;
}
return true;
}
ld func(ll num){
ll sum = 0,am = 0;
while(num > 0){
sum += num % 10;
num /= 10;
am++;
}
return sum/am;
}
signed main() {
ll n;
cin >> n;
ll a[n];
for(ll i = 0; i < n; i++)
cin >> a[i];
for(auto i: a){
if(check_last(i) && check_parity(i))
cout << "Среднее арифметическое числа " << i << " равно: " << func(i) << "\n";
}
}
#include <iostream>
#include <cmath>
#include <algorithm>
#pragma GCC optimize("Ofast")
#define ll long long
#define ld long double
using namespace std;
signed main() {
ll n;
cin >> n;
ll a[n];
for(ll i = 0; i < n; i++)
cin >> a[i];
ld sum = 0, sumkv = 0, sum6 = 0;
ll prod = 1;
for(ll i = 0; i < n; i++){
sum += a[i];
prod *= a[i];
if(i < 6)
sum6 += a[i];
sumkv += pow(a[i],2);
}
ll sum_k = 0;
ll k1,k2;
cin >> k1 >> k2;
for(ll i = k1-1; i < k2; i++)
sum_k+=a[i];
ld av = sum/n;
ld av_s;
ld sum_s = 0;
ll s1,s2;
cin >> s1 >> s2;
for(ll i = s1-1;i < s2; i++)
sum_s += a[i];
av_s = sum_s/(s2-s1 + 1);
cout << "a) " << sum << "\n";
cout << "б) " << prod << "\n";
cout << "в) " << sumkv << "\n";
cout << "г) " << sum6 << "\n";
cout << "д) " << sum_k << "\n";
cout << "е) " << av << "\n";
cout << "ж) " << av_s << "\n";
}