ответ:
n = int(
lstr = (" ")
ns = []
i = 0
tot = 0
while i < n:
ns.append(int(
tot += int(lstr[i])
i += 1
if tot % 5 == 0 and len(ns) > 4:
sm = int(tot / 5)
ns = sorted(ns, reverse=true)
ps = "yes"
su = 0
sk = 0
b = false
for n in ns:
if n ! = 0 and b:
su == 0
sk += 1
b = false
break
if sk == 5:
ps = "no"
break
su += n
if abs(su) > abs(sm):
ps = "no"
break
if su == sm:
b = true
print(ps)
else:
print("no")
объяснение:
ответ:
n = int(
lstr = (" ")
ns = []
i = 0
tot = 0
while i < n:
ns.append(int(
tot += int(lstr[i])
i += 1
if tot % 5 == 0 and len(ns) > 4:
sm = int(tot / 5)
ns = sorted(ns, reverse=true)
ps = "yes"
su = 0
sk = 0
b = false
for n in ns:
if n ! = 0 and b:
su == 0
sk += 1
b = false
break
if sk == 5:
ps = "no"
break
su += n
if abs(su) > abs(sm):
ps = "no"
break
if su == sm:
b = true
print(ps)
else:
print("no")
объяснение:
#include "pch.h"
#include <iostream>
#include <clocale>
using namespace std;
int main() {
setlocale(LC_ALL, "");
int b;
cout << "Введите значение b: ";
cin >> b;
float sum = 0;
int j = 0;
for (int i = b; i <= 100; i++) {
sum += i;
j++;
}
cout << "Среднее арифметическое всех целых чисел от 100 до b: " << sum / j << endl;
return 0;
}